connorferster / forallpeople

Python SI units library: your 'daily driver' for calculations.
Apache License 2.0
272 stars 38 forks source link

Incorrect unit when SQRT(A) is performed #85

Open silviulaurentiu opened 1 year ago

silviulaurentiu commented 1 year ago

image

My expectation is to get the final unit as "A".

The second problem in this case is that the formula is not expanded, only the final result is shown like in above picture.

In case if an unit (doesn't matter what kind of unit) will be added at the end of "c" variable definition, the formula will be expanded: image

but in this case remains the first problem with the unit. sqrt(A**2) shall be = A.

nagatushar commented 4 months ago

1) this is explained in the inconsistent units part of the documentation

2) your first box has parentheses which hide the formula output per the documentation

the second one you have multiplied A outside of the parentheses which makes this a mathematical parentheses not a redundant one that the documentation covers

0av commented 2 months ago

Hello,

math.sqrt is not supporting dimensions. What about using c = (a**2 + b**2/3)**(1/2) or **.5 instead?