cooler-king / quantity

A package to make it easy to work with physical quantities.
MIT License
19 stars 4 forks source link

Precise : computation error #40

Closed vd3d closed 1 year ago

vd3d commented 1 year ago

I got an error in computations when I used the Precise class:

With double:

100.0 * 1007.16 / 10000 = 10.0716

With Precise:

(Precise.num(100.0) * Precise.num(1007.16) / Precise.num(10000)).toDouble() = 0.1716

Is there an error, or it is in the way I use this class ? Any idea ?

Thanks

cooler-king commented 1 year ago

Appears to be an error in the library in the Precise divide operator. Investigating.

cooler-king commented 1 year ago

I expect to push an update that resolves the issue by 11/27,

cooler-king commented 1 year ago

Version 3.0.1 has been published with fixes to the Precise class. Thank you for opening this issue. https://pub.dev/packages/quantity/versions/3.0.1