3 ms·
I didn't have that right, it seems the result certainly can be a class. And that would avoid the units problem. Though in the examples I've seen it wasn't cle
by makecheck 15y ago
I didn't have that right, it seems the result certainly can be a class. And that would avoid the units problem. Though in the examples I've seen it wasn't clear if they were returning a class.
With raw numerical values the results are definitely unpredictable. For example maybe the program considers numerical values to be measured in ounces, in which case "2.2_lb" becomes the number "35.2"; or maybe it thinks everything is metric, measured in grams. There is not just one reasonable way to pick a number to represent an expression.
I am fairly sure that a leading zero cannot be a problem with custom literals; I'd expect the compiler to parse the whole thing and see the suffix before deciding what type of literal it is (i.e. the "_b" handler would get to read everything raw, including the leading zero).