You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Trace: an inverse coherent unit after a fraction reads ambiguously (20000/413 1/kg) #17
When a value has no unit with a symbol, a trace writes the coherent unit spelled from its base units: detail::coherent_unit_text in include/formula-cpp/trace_render.hpp. With #12 this covers every dimensioned value without a symbol. A dimension with only negative exponents is spelled 1/X, so in the fraction number style a line can read:
#3 / #1 = 20000/413 1/kg
At a glance, that reads as one fraction divided again: 20000/413 per 1/kg, or 20000/(413·1) per kg. The value is right; the spelling invites a misreading. The same happens for 1/s, 1/m^3, 1/(m s) and so on.
Expected
An inverse unit after a number cannot be read as part of the number. Options:
negative exponents, kg^-1 (already the caret style the spelling uses for powers);
a per form, per kg;
keeping 1/kg only where the number is not a fraction.
The spelling is pinned in test/opaque_tests.cpp (coherent_unit_text) and in trace texts across the tests and guides; they change with it.
Note
This is a spelling choice, not a correctness bug. The issue is here to make that choice deliberately.
Activity