Open chiphogg opened 1 year ago
Based on discussion on the discord DMs for the C++ standard units library, I think a scaled unit should have the format [M U]
, where M
is the magnitude label, and U
is the label for the unscaled unit. That is: the new label should be fully enclosed in square brackets.
Right now, the unit resulting from scaling a unit by a magnitude gets the default label,
[UNLABELED_UNIT]
. It's important that it not have the same label as the unscaled unit. Still, we can do much better if we design magnitude labels: automatic string constants that represent magnitudes.Possible examples:
"1 / 18"
"Pi / 180"
"5,280"
"(3 * sqrt(3)) / (5 * Pi)"
To solve this, we would need to come up with a collection of canonical examples we can use as acceptance tests, and work out the general rules. We also need to figure out how to handle things like parentheses, powers, and roots.