X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Freal.h;h=0cbc05d85f52ac1729cb7bb1c0af30b1f1f64437;hp=322b02b33de8bcce5fdab624ddde5efadb03d873;hb=6472d20ee58d2ecc0aee8bc1a12a071b2afc8a27;hpb=0361b11485ec41d2c2ddeb279abf846f777f5363 diff --git a/src/real.h b/src/real.h index 322b02b..0cbc05d 100644 --- a/src/real.h +++ b/src/real.h @@ -54,6 +54,8 @@ namespace IPDF typedef Rational Real; inline float Float(const Real & r) {return (float)r.ToDouble();} inline double Double(const Real & r) {return r.ToDouble();} + inline int64_t Int64(const Real & r) {return r.ToInt64();} + inline Rational Sqrt(const Rational & r) {return r.Sqrt();} #else #error "Type of Real unspecified." @@ -69,6 +71,8 @@ namespace IPDF inline double Double(double f) {return (double)f;} inline double Double(long double f) {return (double)(f);} inline double Sqrt(double f) {return sqrt(f);} + inline double Abs(double a) {return fabs(a);} + inline int64_t Int64(double a){return (int64_t)a;} inline Real Power(const Real & a, int n) {