Closed zacps closed 3 years ago
Another unit note, it would be great if it autodetected the appropriate prefix, for example:
1 fm // 1*10^-15 m
1*10^15 // returns 1 000 000 000 000 000 fm instead of 1 m
Are constants like e
and pi
defined in NoteCalc?
Both exp(2)
and e^2
return 2.
Edit: If I'm looking at the right file, they're not?
pi is defined, type .pi
and press tab or simply use the pi()
function.
e
is not defined yet.
( The downvote is because this qustion is totally irrelevant for this issue)
pi is defined, type
.pi
and press tab or simply use thepi()
function.
Ah, I see. Thanks!
( The downvote is because this qustion is totally irrelevant for this issue)
Well, I asked that because the author of the issue uses e
in this line:
n0*e^(decayconst*(100 years))
...and I thought maybe e
not being defined is a reason.
Oh I see, you are right, sorry then!
I close this issue:
ln
function nor the e
const.1*10^15 fm in m
It is not obvious when the user wants to see the result in the exact unit as the input, or when it is preferable to have a more user-friendly output, so currently the user has to specify it explicitly.
Later there might be a global option for controlling it in the whole note..
To be clear the second part was not asking for unit conversions, just for SI prefixes to be used automatically, i.e. if the unit was already meters (as above) and the associated value was outside of the range [0,1000) then the appropriate SI prefix would be added.
Edit: My mistake about e
and ln
not being defined, I'd like to see those added as they are both extremely common.
First of all, super cool tool; I can see myself using this a lot.
In the following calculation the last result has no unit, when it should have the unit
mol
:halflife = 1.5 years decayconst = ln(2)/halflife n0 = 1 mol n0*e^(decayconst*(100 years))
I am not sure if this is the expected result, but in the latest version (0.3.0, will be released tomorrow), this works
halflife = 1.5 years █ 1.5 year
decayconst = ln(2)/halflife █ 0.4620981203732966666663863889 / year
n0 = 1 mol █ 1 mol
n0*e()^(decayconst*100 years) █ 94 961 194 206 024 488 745.13364918 mol
First of all, super cool tool; I can see myself using this a lot.
In the following calculation the last result has no unit, when it should have the unit
mol
: