Open CRImier opened 6 years ago
the problem is in how floating point numbers are internally stored: as a binary sequence and exponent. 0.1 decimal in binary is 0.00011001100110011.. etc., so it's not possible to store it perfectly. One idea is to use fixed point arithmetic - pre-multiply every number by let's say 1,000,000,000 , then divide the result.
Yeah, I'm sure there's even a tried and true algorithm on Stackoverflow or somewhere else that most of the calculator apps use to avoid the precision problems =) The biggest effort will, surely, go into the calculator UI and user-friendliness, the eval
part is mentioned in a way that "we need somebody to write an app, and in case you're worried about the backend you should use, here's an easy-to-use backend that we're OK with you using, and here are some amusing examples of it failing =)"
@j340m3 this seems like exactly what we'd be looking for, from the first glance, thank you!
Some features that would be cool to have (some more advanced ones reached by navigating menus maybe):
@KyleMoran138 has made a basic app that uses
Decimals
, and it's now indevel
. However, the UI isn't user-friendly enough - my proposal is to have a single-screen app:On the screen, it would show:
Quick mockup of the screen layout:
Later on, we could add an option to hide the controls' disambiguation, for a less bloated UI (and, probably, being able to show more numbers in return).