question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Time units handled incorrectly

See original GitHub issue

Description

When using the Online IDE with Calcpad, time units (s, min, h, Hz) are not handled correctly. This makes calculations such as Rotations Per Minute quite prone to error.
A specific example is 1 / 1min = 1 h^-1 in calcpad. As well, the default units of multiplications of 1 min * 1 ms are h.

Screenshots

image

To Reproduce

I used the following to show unexpected bahaviour

t = 1min
1/t
t * 1 Hz
t_2 = 1 ms
1/t_2
t * t_2

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FifoIrontoncommented, Apr 19, 2022

Great to see the tool improving. Thanks!

1reaction
FifoIrontoncommented, Apr 18, 2022

Thanks for looking into this! I found another issue with time units when playing around: image

I would expect this to give y=60 min^-1, rather than 60 s^-1

x = 1/s
y = x * 60 s / min
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Mixups
Here are some incidents that involved confusion between units or systems of measurement. They vary in significance and seriousness, ...
Read more >
I always wondered what if time is not as we measure it. ...
The problem is that the units of other quantities like length, mass, current etc. have no natural scale or value to compare to....
Read more >
Time formatting and storage bugs
In computer science, time formatting and storage bugs are a class of software bugs that cause errors in time and date calculation or...
Read more >
Dimensions, Units and Conversions
Dimensional Consistency. Dimensions and units must be handled consistently in any algebraic calculation. To be added, two quantities must have the same ...
Read more >
Why of all units is Time standard?
Most likely because it wasn't until the modern era that anyone really needed, or could achieve, much precision with time measurements.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found