Math··5 min read
Converting units without losing precision
Rounding errors add up. Here's how to convert between units — length, mass, temperature — while keeping your numbers honest.
Multiply, don't approximate
Every unit conversion is a multiplication by a defined ratio. 1 inch is *exactly* 25.4 mm. 1 pound is *exactly* 0.45359237 kg. Use the full-precision constant, then round only at the display step.
Temperature is affine, not linear
°F to °C isn't a simple multiplier — it's (F − 32) × 5/9. And Kelvin adds an offset of 273.15. Chaining conversions through Kelvin avoids compounding rounding on the offset.
Show the right number of digits
The result shouldn't claim more precision than the input. If someone typed 5 ft, converting to 1524.0 mm is silly — 1500 mm reflects the input's precision.
Try it
Explore all converters — each one keeps full-precision math internally and rounds only for display.