fix for borland
authorClaus Gittinger <cg@exept.de>
Mon, 14 May 2018 10:33:07 +0200
changeset 22919 1f77f065b31e
parent 22918 ed09bf19e476
child 22920 ab4f159ef843
fix for borland
ShortFloat.st
--- a/ShortFloat.st	Mon May 14 09:40:27 2018 +0200
+++ b/ShortFloat.st	Mon May 14 10:33:07 2018 +0200
@@ -130,11 +130,13 @@
 # define NO_ASINH
 # define NO_ACOSH
 # define NO_ATANH
+
 # ifdef __BORLANDC__
 #  define NO_FMODF
 #  define NO_MODFF
 #  define NO_LOG10F
 #  define NO_LOGF
+#  define NO_ABSF
 # endif
 
 # ifdef __MINGW__
@@ -1177,10 +1179,16 @@
 
     // Check if the numbers are really close -- needed
     // when comparing numbers near zero (ULP method below fails for numbers near 0!).
+# ifdef NO_ABSF
+    if (absf((double)(myself.f - otherFloat.f)) <= scaledEpsilon) {
+        RETURN(true);
+    }
+# else
     // fprintf(stderr, "%.10f %.10f\n", fabsf(myself.f - otherFloat.f), scaledEpsilon);
     if (fabsf(myself.f - otherFloat.f) <= scaledEpsilon) {
         RETURN(true);
     }
+#endif
 
     // if the signs differ, the numbers are different
     if ((myself.f >= 0) != (otherFloat.f >= 0)) {