X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Freal%2Felem%2Fcl_R_equal.cc;h=b3060ce4e701d6919ace1673fc22c96c0a662a2a;hb=5370ad8054201cf23d4f94a52f4d3f7f9f3cd511;hp=6d6f17eb604968916dd42f01409d811a4edaf1c4;hpb=dd9e0f894eec7e2a8cf85078330ddc0a6639090b;p=cln.git diff --git a/src/real/elem/cl_R_equal.cc b/src/real/elem/cl_R_equal.cc index 6d6f17e..b3060ce 100644 --- a/src/real/elem/cl_R_equal.cc +++ b/src/real/elem/cl_R_equal.cc @@ -1,24 +1,26 @@ -// cl_equal(). +// equal(). // General includes. #include "cl_sysdep.h" // Specification. -#include "cl_real.h" +#include "cln/real.h" // Implementation. #include "cl_R.h" #include "cl_RA.h" -#include "cl_integer.h" +#include "cln/integer.h" -inline cl_boolean cl_equal (const cl_F& x, const cl_F& y) +namespace cln { + +inline bool equal (const cl_F& x, const cl_F& y) { - return (cl_boolean) (cl_compare(x,y) == 0); + return compare(x,y) == 0; } -cl_boolean cl_equal (const cl_R& x, const cl_R& y) +bool equal (const cl_R& x, const cl_R& y) { // Methode: // Beide rational oder beide Floats -> klar. @@ -30,23 +32,25 @@ cl_boolean cl_equal (const cl_R& x, const cl_R& y) realcase2(x , realcase2(y , // beides rationale Zahlen - return cl_equal(x,y); + return equal(x,y); , // x rational, y Float -> x in Float umwandeln if (!power2p(denominator(x))) - return cl_false; - if (!cl_equal(cl_float(x,y),y)) - return cl_false; - return cl_equal(x,rational(y)); + return false; + if (!equal(cl_float(x,y),y)) + return false; + return equal(x,rational(y)); ); , realcase2(y , // x Float, y rational -> y in Float umwandeln if (!power2p(denominator(y))) - return cl_false; - if (!cl_equal(x,cl_float(y,x))) - return cl_false; - return cl_equal(rational(x),y); + return false; + if (!equal(x,cl_float(y,x))) + return false; + return equal(rational(x),y); , // beides Floats - return cl_equal(x,y); + return equal(x,y); ); ); } + +} // namespace cln