Native Python support for units?
Native Python support for units?
Posted Jul 30, 2022 16:53 UTC (Sat) by Wol (subscriber, #4433)In reply to: Native Python support for units? by NYKevin
Parent article: Native Python support for units?
Ten SQUARED is a hundred - 10e2.
Cheers,
Wol
Posted Jul 30, 2022 17:57 UTC (Sat)
by anselm (subscriber, #2796)
[Link] (4 responses)
Posted Jul 30, 2022 20:34 UTC (Sat)
by Wol (subscriber, #4433)
[Link] (3 responses)
But 10e1 is rather odd notation - 10 x 10^1
I'm used to either scientific notation where it's en and n is a multiple of 3, or (dunno what it's called) where 1 <= mantissa < 10.
( I know some people prefer the mantissa between 0 and 1, rather than 1 and 10, but the combination of mantissa not between 0 and ten, and exponent not a multiple of 3, is, well, weird!)
Cheers,
Posted Jul 30, 2022 23:51 UTC (Sat)
by rschroev (subscriber, #4164)
[Link] (1 responses)
When communicating with other people it's probably best to stick with either scientific notation in the strict sense (1 <= mantissa < 10) or engineering notation (exponent is a multiple of 3, 1 <= mantissa < 1000), but other representations are just as valid and programming languages don't care in the least how you scale the exponent.
Posted Jul 31, 2022 7:50 UTC (Sun)
by Wol (subscriber, #4433)
[Link]
But brains usually do ... :-)
Cheers,
Posted Jul 31, 2022 17:21 UTC (Sun)
by anselm (subscriber, #2796)
[Link]
Scientific pocket calculators (are these still a thing?) used to call the “1 ≤ mantissa < 10 and arbitrary exponent” style “scientific” and the “1 ≤ mantissa < 1000, exponent a multiple of 3” style “engineering”.
Native Python support for units?
Don't you mean 10e1 is 10.0 - 10 to the power 1?
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1e1
10.0
>>> 1e2
100.0
>>> 10e1
100.0
>>>
Native Python support for units?
Wol
Native Python support for units?
Native Python support for units?
Wol
Native Python support for units?
I'm used to either scientific notation where it's en and n is a multiple of 3, or (dunno what it's called) where 1 ≤ mantissa < 10.
