uestla / Simplex-Calculator

PHP tool for linear programming problems solving
http://simplex.wz.cz/
39 stars 19 forks source link

Prevent faulty loops on a Fraction creation from decimals #8

Closed piotrknapik closed 3 years ago

piotrknapik commented 3 years ago

Found this issue sometimes leading to "[Exception] Division by zero.".

Test is covering the example of such behavior: $f = new Fraction(0.14) gives 5468750000000001 / 39062500000000000 (instead of 5/70)

uestla commented 3 years ago

That's a nice catch! Float behavior in PHP won't stop to amaze me :-)

Thank you very much!

piotrknapik commented 3 years ago

@uestla happy to help. Could you release 1.0.6 with the fix?

uestla commented 3 years ago

Released :-) Thanks again!