ShortFloat.st
changeset 14727 10825e6940d3
parent 14719 a354c1ef4a56
child 14741 4a898f7517d5
child 18022 f23232c2eaef
--- a/ShortFloat.st	Mon Jan 28 19:04:13 2013 +0100
+++ b/ShortFloat.st	Tue Jan 29 10:54:03 2013 +0100
@@ -120,6 +120,10 @@
 # define NO_ASINH
 # define NO_ACOSH
 # define NO_ATANH
+# ifdef __BORLANDC__
+#  define NO_FMODF
+#  define NO_MODFF
+# endif
 #endif /* WIN32 */
 
 #ifdef solaris
@@ -1652,12 +1656,20 @@
      such that (self truncated + self fractionPart) = self"
 
 %{  /* NOCONTEXT */
-
-    float modff(float, float*);
+#ifdef NO_MODFF
+    double dFrac, dTrunc;
+#else
+    float modff(float, float *);
+#endif
     float frac, trunc;
 
     __threadErrno = 0;
+#ifdef NO_MODFF
+	dFrac = modf((double)__shortFloatVal(self), &dTrunc) ;
+	frac = (float)dFrac;
+#else
     frac = modff(__shortFloatVal(self), &trunc);
+#endif
     if (! isnan(frac)) {
 	if (__threadErrno == 0) {
 	    RETURN (__MKSFLOAT(frac));
@@ -1851,10 +1863,10 @@
 !ShortFloat class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.115 2013-01-26 15:03:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.116 2013-01-29 09:54:03 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.115 2013-01-26 15:03:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.116 2013-01-29 09:54:03 cg Exp $'
 ! !