With deepReduce(), when a simplifiaction was interrupted, expression could
contain Undefined children, which would trigger the assert in
removeUnit(). With reduce(), if a simplification is interrupted, the
entire expression becomes Undefined, which is handled by removeUnits().
UnitConvert must set UnitConversion to None, otherwise the unit asked
for in the conversion might get changed after being properly set in
UnitConvert::shallowBeautify.
Temperatures can be converted to and from degree Celsius and Fahrenheit.
When used in non-trivial calculations, they are always reduced to undef,
as the rules for manipulating relative scales are not well defined.
Change-Id: If59e224a0e7f940b421bc894bbe2279c90f38d04
In UnitConvert::shallowBeautify, an orphan expression would be reduced
without reaffecting the reduction's result. The reduction not being
taken into account would cause problem when handling undef values.
ex : Try to calculate i->_min
Change-Id: I4e53afa40ba838fed8c2fba9944c9c9ed1dc95b4
First reduce the right member by replacing the units to make sure there
is a unit, then reduce without replacing to keep "complex units" such as
L, N, ...