ekg / fraction.js

A fraction math library in javascript.
http://hypervolu.me/~erik/fraction.js/
165 stars 43 forks source link

Cannot add to a fraction of value 0 #3

Open alexcoplan opened 10 years ago

alexcoplan commented 10 years ago

Hello,

Trying the following:

f = new Fraction(0);
console.log( f.add(new Fraction(1,2)).toString() );

Gives NaN (I'm guessing there's a divide by zero error somewhere?)

Would be great if this could be fixed or if there is a workaround.

Thanks