Handling dimensionally inconsistent calculations
mainSome formulas require 'hidden dimensions' (e.g., $\sqrt{MPa}$ resulting in $MPa$ instead of $MPa^{0.5}$). forallpeople handles this via the __float__ method.
When float(physical_instance) is called, it returns the numerical portion of the auto-prefixed unit representation rather than the raw SI base value. This allows standard math functions (like math.sqrt) to work with the 'visible' number.
Warning: If you need to perform calculations on the actual SI base unit value, use .value explicitly.
import forallpeople as si
from math import sqrt
si.environment('default')
MPA = 1e6 * si.Pa
f_c = 35 * MPA
# Using the auto-prefixed value (matches visual representation)
result = sqrt(f_c) * MPA # 5.916 MPa
# Using the actual SI base value
result_base = sqrt(f_c.value) # 5916.079...