X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Frational.h;h=f9157c766f6b41f0fbdf061f3369183c500f81cc;hp=b01950533ad6810653c724f8924f68d4f982690c;hb=0361b11485ec41d2c2ddeb279abf846f777f5363;hpb=63554274d8ca1b51b47da55c978c3354a91567bc diff --git a/src/rational.h b/src/rational.h index b019505..f9157c7 100644 --- a/src/rational.h +++ b/src/rational.h @@ -77,6 +77,8 @@ struct Rational { Simplify(); } + + Rational(const T & _P, const T & _Q) : P(_P), Q(_Q) { @@ -174,7 +176,7 @@ struct Rational double ToDouble() const { T num = P, denom = Q; - while (Tabs(num) > T(DBL_MAX)) + while (Tabs(num) > T(1e10)) { num /= T(16); denom /= T(16); @@ -206,8 +208,6 @@ struct Rational - - } #endif //_RATIONAL_H