--- a/Float.st Mon Dec 02 10:43:47 2019 +0100
+++ b/Float.st Mon Dec 02 10:45:32 2019 +0100
@@ -58,10 +58,6 @@
# include <locale.h>
#endif
-#if defined (__aix__)
-# include <float.h>
-#endif
-
#if defined(__irix__)
# include <nan.h>
#endif
@@ -896,8 +892,6 @@
%{
#ifdef __BORLANDC__
-#include <float.h>
-
// Set precision to long double / 64bit
int result = _control87(PC_64, MCW_PC);
RETURN(__MKSMALLINT(result));
@@ -1038,7 +1032,7 @@
numBitsInMantissa
"answer the number of bits in the mantissa (the significant).
This is an IEEE double (binary64), where 52 bits are available (the hidden bit is not counted here):
- seeeeeee eeeemmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm
+ seeeeeee eeeemmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm
"
^ 52
@@ -2425,24 +2419,24 @@
int len;
if (__isStringLike(formatString)) {
- /*
- * actually only needed on sparc: since thisContext is
- * in a global register, which gets destroyed by printf,
- * manually save it here - very stupid ...
- */
- __BEGIN_PROTECT_REGISTERS__
-
- len = snprintf(buffer, sizeof(buffer), __stringVal(formatString), __floatVal(self));
-
- __END_PROTECT_REGISTERS__
-
- if (len < 0) goto fail;
- if (len >= sizeof(buffer)) goto fail;
-
- s = __MKSTRING_L(buffer, len);
- if (s != nil) {
- RETURN (s);
- }
+ /*
+ * actually only needed on sparc: since thisContext is
+ * in a global register, which gets destroyed by printf,
+ * manually save it here - very stupid ...
+ */
+ __BEGIN_PROTECT_REGISTERS__
+
+ len = snprintf(buffer, sizeof(buffer), __stringVal(formatString), __floatVal(self));
+
+ __END_PROTECT_REGISTERS__
+
+ if (len < 0) goto fail;
+ if (len >= sizeof(buffer)) goto fail;
+
+ s = __MKSTRING_L(buffer, len);
+ if (s != nil) {
+ RETURN (s);
+ }
}
fail: ;
#endif /* not __SCHTEAM__ */
@@ -2773,8 +2767,8 @@
if (! (isnan(myVal) || isinf(myVal)))
#endif
{
- frac = frexp(myVal, &exp);
- RETURN (__MKFLOAT(frac));
+ frac = frexp(myVal, &exp);
+ RETURN (__MKFLOAT(frac));
}
%}.
^ super mantissa
@@ -2782,8 +2776,8 @@
"
1.0 exponent
1.0 mantissa
- -1.0 exponent
- -1.0 mantissa
+ -1.0 exponent
+ -1.0 mantissa
0.25 exponent
0.25 mantissa
--- a/ShortFloat.st Mon Dec 02 10:43:47 2019 +0100
+++ b/ShortFloat.st Mon Dec 02 10:45:32 2019 +0100
@@ -53,9 +53,7 @@
# include <locale.h>
#endif
-#if defined (__aix__)
-# include <float.h>
-#endif
+#include <float.h>
#if defined(__irix__)
# include <nan.h>
@@ -699,7 +697,6 @@
"The largest exponent value allowed by instances of this class."
%{ /* NOCONTEXT */
-#include <float.h>
#if defined(FLT_MAX)
RETURN(__MKSFLOAT(FLT_MAX));
#endif
@@ -718,7 +715,6 @@
"The largest exponent value allowed by instances of this class."
%{ /* NOCONTEXT */
-#include <float.h>
#if defined(FLT_MIN)
RETURN(__MKSFLOAT(FLT_MIN));
#endif
@@ -759,9 +755,9 @@
numBitsInMantissa
"answer the number of bits in the mantissa (the significant).
- This is an IEEE single (binary32), where 23 bits are available
+ This is an IEEE single (binary32), where 23 bits are available
(the hidden bit is not counted here):
- seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
+ seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
"
^ 23
@@ -1784,24 +1780,24 @@
int len;
if (__isStringLike(formatString)) {
- /*
- * actually only needed on sparc: since thisContext is
- * in a global register, which gets destroyed by printf,
- * manually save it here - very stupid ...
- */
- __BEGIN_PROTECT_REGISTERS__
-
- len = snprintf(buffer, sizeof(buffer), __stringVal(formatString), __shortFloatVal(self));
-
- __END_PROTECT_REGISTERS__
-
- if (len < 0) goto fail;
- if (len >= sizeof(buffer)) goto fail;
-
- s = __MKSTRING_L(buffer, len);
- if (s != nil) {
- RETURN (s);
- }
+ /*
+ * actually only needed on sparc: since thisContext is
+ * in a global register, which gets destroyed by printf,
+ * manually save it here - very stupid ...
+ */
+ __BEGIN_PROTECT_REGISTERS__
+
+ len = snprintf(buffer, sizeof(buffer), __stringVal(formatString), __shortFloatVal(self));
+
+ __END_PROTECT_REGISTERS__
+
+ if (len < 0) goto fail;
+ if (len >= sizeof(buffer)) goto fail;
+
+ s = __MKSTRING_L(buffer, len);
+ if (s != nil) {
+ RETURN (s);
+ }
}
fail: ;
#endif /* not __SCHTEAM__ */
@@ -2084,11 +2080,11 @@
#endif
{
#if defined(__i386__) && defined(__GNUC__)
- float frac = frexpf(myVal, &exp);
- RETURN (__MKSFLOAT(frac));
+ float frac = frexpf(myVal, &exp);
+ RETURN (__MKSFLOAT(frac));
#else
- double frac = frexp( (double)(myVal), &exp);
- RETURN (__MKFLOAT(frac));
+ double frac = frexp( (double)(myVal), &exp);
+ RETURN (__MKFLOAT(frac));
#endif
}
%}.