uestla / Simplex-Calculator

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

Lots of abs in gcd function #15

Closed Domi04151309 closed 1 year ago

Domi04151309 commented 1 year ago

Since lines 29 and 30 already calculate the absolute values, I assume that any additional calls to abs later on should not change the values. gcdRecursive should not return a negative value because both inputs to the modulo operation are already positive.

Something to read about %: https://www.php.net/manual/en/language.operators.arithmetic.php

uestla commented 1 year ago

Thanks a lot!