X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Frational.h;h=f9157c766f6b41f0fbdf061f3369183c500f81cc;hp=b01950533ad6810653c724f8924f68d4f982690c;hb=8b3424a48d2d2e20de1a0e60ff6e1d84b9b5e226;hpb=35f1190c8c8036ed11180656769cf0c1cbf7c2b3 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