X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/db2bf4111cde36048ac66bbac58547d105bc7e80..67b5031ec6d160b5cae425466a34d1be3b211dd4:/struct/buf-float.c?ds=sidebyside diff --git a/struct/buf-float.c b/struct/buf-float.c index 502b96b..88d6c44 100644 --- a/struct/buf-float.c +++ b/struct/buf-float.c @@ -32,6 +32,7 @@ #include "bits.h" #include "buf.h" +#include "maths.h" /*----- Formatting primitives ---------------------------------------------*/ @@ -80,24 +81,6 @@ static kludge64 f64_to_k64(double x) /* Some machinery before we start. */ -#ifdef isnan -# define NANP(x) isnan(x) -#else -# define NANP(x) (!((x) == (x))) -#endif - -#ifdef isinf -# define INFP(x) isinf(x) -#else -# define INFP(x) ((x) > DBL_MAX || (x) < -DBL_MAX) -#endif - -#ifdef signbit -# define NEGP(x) signbit(x) -#else -# define NEGP(x) ((x) < 0) /* incorrect for negative zero! */ -#endif - if (NANP(x)) { /* A NaN. */ hi = 0x7ff80000; lo = 0; @@ -168,10 +151,6 @@ static kludge64 f64_to_k64(double x) /* Convert to external format and go home. */ SET64(k, hi, lo); return (k); - -#undef NANP -#undef INFP -#undef NEGP } /* --- @k64_to_f64@ --- *