3 ms·
Temperature, times, dates, cgs vs mks, dimensionless quantities, angles, the list goes on and on. And that’s before you get into the technical details of how y
by db48x 6y ago
Temperature, times, dates, cgs vs mks, dimensionless quantities, angles, the list goes on and on.
And that’s before you get into the technical details of how you store units and conversion factors in memory, how you handle precision when mixing large and small units, how you interact with unlimited‐precision and rational numbers, how you use or avoid the type system in your programming language, how users of your unit library define their own units…
Here’s a good write‐up of what they’re thinking about for future versions of C++: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1935r2.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p193.... It’s worth a read even if you don’t write in C++.
And if you bake it into your language, you’d better get it all right the first time, because you probably won’t be able to fix it later.