In certain cases, b becomes very small (2.0e-14) and never converges to 0.
@@ -64,7 +64,7 @@ export class Fraction {
return 1;
}
- while (b !== 0) {
+ while (Math.abs(b) > 0.0000001) {
if (a > b) {
a -= b;
} else {