Hacker News new | ask | show | jobs
by kstrauser 590 days ago
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.

1 comments

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