6 ms·
We use high-precision calculations up to 28 decimal digits that cannot be provided by numeric types available in Javascript. That’s why we do our calculations o
by rpcom 2y ago
We use high-precision calculations up to 28 decimal digits that cannot be provided by numeric types available in Javascript. That’s why we do our calculations on the backend.
- eitally 2y agoWhich is cool and all, but totally unnecessary for approximately 100% of users. You should at least provide an option to do everything in js. Also, for ux reasons, I'd love this as a browser extension. Cloudy Calculator can do a lot of it but was recently deprecated as a result of the Manifest v2->v3 requirement from Google.
- rpcom 2y agoWhen 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.
- kstrauser 2y agoYour 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.
- rpcom 2y agoThat’s right - we cannot beat lack of fractions support with whatever high precision. It’s a feature that we are currently missing.
- kstrauser 2y agoI can't think of an example of a real-life measurement with 28 decimal digits of precision, and if there is, I bet they have a custom converter. Please don't be the calculator that ignores significant digits and encourages people to write nonsense things like "an adult blue whale can be up to 29.9 meters (1177.16535 inches) long".
- itishappy 2y ago> I can't think of an example of a real-life measurement with 28 decimal digits of precision... Pretty sure there aint one. https://en.wikipedia.org/wiki/List_of_physical_constants https://en.wikipedia.org/wiki/List_of_physical_constants https://physics.stackexchange.com/questions/497087/what-is-the-most-precise-physical-measurement-ever-performed https://physics.stackexchange.com/questions/497087/what-is-t...
- kstrauser 2y agoAgreed. And here's NASA explaining why they only bother with 15 digits of PI: https://www.jpl.nasa.gov/edu/news/how-many-decimals-of-pi-do-we-really-need/ https://www.jpl.nasa.gov/edu/news/how-many-decimals-of-pi-do... > Think about that. We have a circle more than 94 billion miles (more than 150 billion kilometers) around, and our calculation of that distance would be off by no more than the width of your little finger. Anyone who needs more precision than that is almost certainly sitting next to a computer with bespoke software running on it.
- giancarlostoro 2y agoOne way around this might be to test and see if you can do it via WebAssembly that the JS calls, just not sure off the too of my head how I would personally do it. As others noted though, thats a lot of precision that maybe not everyone needs, maybe a checkbox for more precision that then calls the backend?
- botanical76 2y agoI'm finding it hard to buy that a precision of 28 decimal digits cannot be computed on today's browsers. Why could you not have used one of the bigfloat[1] JavaScript libraries that exists? Is there an operation the service requires which is not supported by them? In any case, thank you for the free service. I'm sure this will be useful to a lot of people. While I would not use a cloud-based calculator, I'm sure a lot of laypeople don't care how it's done, and I appreciate your focus on utmost accuracy. [1] - https://github.com/davidmartinez10/bigfloat https://github.com/davidmartinez10/bigfloat
- rpcom 2y agoWe use C# “decimal” type on backend for high-precision calculations. Frankly, we do not trust third-party libraries when it comes to mission critical calculations. We would better stay safe with well-tested enterprise frameworks like .NET.
- kstrauser 2y agoOK, now you're just trolling. Got it. Although I was a little, um, assertive in some of my comments here, I honestly mean them constructively, in the spirit of "here are some things you might consider to make it more useful". I apologize for missing the joke.
- unsnap_biceps 2y agoPlease add support for 35 decimal digits so I can convert Planck lengths to miles.