Dividing a unit by itself, or raising one to the zeroth power, builds a unit string with
zero exponents instead of returning UNIT_DIMENSIONLESS, furthermore the string it
returns can't be parsed.
das_units a = Units_fromStr("V/m");
das_units d = Units_divide(a, a); /* "V**0 m**0", not UNIT_DIMENSIONLESS */
das_units p = Units_power(a, 0); /* same */
Both calls report:
ERROR: Error parsing units string 'V**0 m**0' at byte number 4
(reported from das3/units.c:662, _Units_strToComponents)
and then return a usable-looking string pointer anyway. Units_reduce() on the
result logs a second error and returns the same string.
Expected results:
- zero-exponent components should drop out of the result.
- das2C shouldn't return strings it can't parse.
Where to look: das3/units.c, Units_divide() down into _Units_strToComponents()
near line 662, also check Units_power()
Dividing a unit by itself, or raising one to the zeroth power, builds a unit string with
zero exponents instead of returning UNIT_DIMENSIONLESS, furthermore the string it
returns can't be parsed.
Both calls report:
and then return a usable-looking string pointer anyway.
Units_reduce()on theresult logs a second error and returns the same string.
Expected results:
Where to look: das3/units.c,
Units_divide()down into_Units_strToComponents()near line 662, also check
Units_power()