apesic / rpncalc

A simple RPN (Reverse Polish Notation) calculator app built using Flutter
GNU General Public License v3.0
27 stars 1 forks source link

Precise floating point math #5

Closed dozed-dev closed 1 year ago

dozed-dev commented 3 years ago

Binary floating point math is imprecise when dealing with decimal numbers, for example 1.1 0.5 - is calculated as 0.6000000000000001. This could be solved if the numbers are represented as rational internally, because rational numbers use integer math.

This library, for example, provides computations on rational numbers.

I hope this won't be too much trouble to implement, and thank you for making this app :)

apesic commented 3 years ago

Thanks for sharing that library--I'll take a look at how hard it will be to implement this.

apesic commented 3 years ago

Gave this a try and it was a simple change, so this fix will be included in the next release. I'll probably be able to have it out on the Google Play version next week, but given the slow and unpredictable pace of F-Droid's build + release process, it may be a few weeks before it lands there.

wviana commented 1 year ago

So this was already solved wan't it?