Hacker News new | ask | show | jobs
by rpcom 589 days ago
When a user converts, for example, 0.0001 millimeters to miles, most of converters out there will fail to provide the correct result due to precision loss. I know, it’s rare case, but we want to ensure that we can handle all cases without exception.
1 comments

Your site doesn't work by that standard. English<=>metric distance eventually comes down to how accurately you can represent 1/127 (because 1in==25.4mm). 1/127 repeats after 42 digits and you only support 28.

You can't give exact answers without representing everything as fractions, even for the easy ones like mm to miles. With that being true, anything more than JavaScript's own precision is probably unhelpful.

The kind of person solving problems where they'd need to convert between miles and mm would rewrite the constant as "1mi = 1,609,344mm". No one in the real world is adding up 0.0001mm intervals until they get to a mile, so you're solving for a problem that doesn't actually exist.

That’s right - we cannot beat lack of fractions support with whatever high precision. It’s a feature that we are currently missing.