4 ms·
Ahh, thank you. Yes indeed: bc says: >>> sqrt(10) * sqrt(10) 9.99999999999999999994 Android calculator, on the other hand, gets this one right.
by dgacmu 2y ago
Ahh, thank you.
Yes indeed: bc says:
>>> sqrt(10) * sqrt(10)
9.99999999999999999994
Android calculator, on the other hand, gets this one right.
- gavinhoward 2y agoGavin Howard here. Yes, GP is entirely correct. I want to do something like the article, but the bc standard (POSIX) requires a decimal BigInteger representation. I am glad you like my bc!
- tialaramex 2y agoI actually use bc a lot and the fact it's just the big rationals was annoying which is why I set off on the route that ended with my crate `realistic` Amusingly one of the things I liked in bc was that I could write stuff like sqrt(10) * sqrt(40) and it works -- but even the more-bc-like command line toy for my own use doesn't do this, turns out a few months of writing the guts of a computable reals implementation makes (* (sqrt 10) (sqrt 40)) seem like a completely reasonable way to write what I meant and so "Make it work like bc" faded from "Important" to "Eh, whatever I'll get to it later". If you'd asked me a year ago if "fix edge case bugs in converting realistic::Real to f64" would happen before "Have natural expressions like 1 + 2 * 3 do what is expected" I'd have said not a chance, but shows how much I knew.