|
|
|
|
|
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. |
|
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.