ShortFloat.st
changeset 21955 c6b82cbb4b6a
parent 21950 f5852ca02a75
child 21956 7a51828d5c96
--- a/ShortFloat.st	Mon Jul 03 15:18:49 2017 +0200
+++ b/ShortFloat.st	Mon Jul 03 15:18:59 2017 +0200
@@ -1296,26 +1296,27 @@
 
     val = __shortFloatVal(self);
 
-# ifdef __win32__ /* to suppress the warnBox opened by win32 */
-    if (val > 0.0)
-# endif
-    {
-	__threadErrno = 0;
+    /* 
+     * to suppress the warnBox opened by win32 
+     * to avoid returning -INF from some unix math libs (__osx__)
+     */
+    if (val > 0.0) {
+        __threadErrno = 0;
 # ifdef NO_LOG10F
-	{
-	    double dRslt = log10((double)val);
-	    rslt = (float)dRslt;
-	}
+        {
+            double dRslt = log10((double)val);
+            rslt = (float)dRslt;
+        }
 # else
-	rslt = log10f(val);
+        rslt = log10f(val);
 # endif
-	if (! isnanf(rslt))  /* Currently all our systems support isnan() */
-	{
-	    if (__threadErrno == 0) {
-		__qMKSFLOAT(newFloat, rslt);
-		RETURN ( newFloat );
-	    }
-	}
+        if (! isnanf(rslt))  /* Currently all our systems support isnan() */
+        {
+            if (__threadErrno == 0) {
+                __qMKSFLOAT(newFloat, rslt);
+                RETURN ( newFloat );
+            }
+        }
     }
 #endif
 %}.
@@ -1323,11 +1324,11 @@
      an invalid value for logarithm
     "
     ^ self class
-	raise:#domainErrorSignal
-	receiver:self
-	selector:#log10
-	arguments:#()
-	errorString:'bad receiver in log10'
+        raise:#domainErrorSignal
+        receiver:self
+        selector:#log10
+        arguments:#()
+        errorString:'bad receiver in log10 (not strictly positive)'
 
     "
      10 asFloat log10       1.0
@@ -1342,6 +1343,7 @@
     "
 
     "Created: / 16-06-2017 / 10:47:53 / cg"
+    "Modified: / 03-07-2017 / 15:16:32 / cg"
 ! !
 
 !ShortFloat methodsFor:'printing & storing'!