a14n / dart-rational

Apache License 2.0
35 stars 20 forks source link

toStringWithPrecision() should not use toDouble() #7

Closed stevenroose closed 5 years ago

stevenroose commented 10 years ago

toStringWithPrecision() uses toDouble() to first create a double type of the object. This means that very large numbers can be represented incorrectly using this method.

It should be possible to create a fully correct fixed-precision string using the internal numerator and denominator.

davidfaulks commented 5 years ago

Thank you, a14n, for fixing this.

a14n commented 5 years ago

Fixed via #20