ShortFloat.st
changeset 14727 10825e6940d3
parent 14719 a354c1ef4a56
child 14741 4a898f7517d5
child 18022 f23232c2eaef
equal deleted inserted replaced
14726:af723d15ccf8 14727:10825e6940d3
   118 # endif
   118 # endif
   119 
   119 
   120 # define NO_ASINH
   120 # define NO_ASINH
   121 # define NO_ACOSH
   121 # define NO_ACOSH
   122 # define NO_ATANH
   122 # define NO_ATANH
       
   123 # ifdef __BORLANDC__
       
   124 #  define NO_FMODF
       
   125 #  define NO_MODFF
       
   126 # endif
   123 #endif /* WIN32 */
   127 #endif /* WIN32 */
   124 
   128 
   125 #ifdef solaris
   129 #ifdef solaris
   126 # ifndef isfinite
   130 # ifndef isfinite
   127 #  define isfinite(f) finite((double)(f))
   131 #  define isfinite(f) finite((double)(f))
  1650 fractionPart
  1654 fractionPart
  1651     "extract the after-decimal fraction part.
  1655     "extract the after-decimal fraction part.
  1652      such that (self truncated + self fractionPart) = self"
  1656      such that (self truncated + self fractionPart) = self"
  1653 
  1657 
  1654 %{  /* NOCONTEXT */
  1658 %{  /* NOCONTEXT */
  1655 
  1659 #ifdef NO_MODFF
  1656     float modff(float, float*);
  1660     double dFrac, dTrunc;
       
  1661 #else
       
  1662     float modff(float, float *);
       
  1663 #endif
  1657     float frac, trunc;
  1664     float frac, trunc;
  1658 
  1665 
  1659     __threadErrno = 0;
  1666     __threadErrno = 0;
       
  1667 #ifdef NO_MODFF
       
  1668 	dFrac = modf((double)__shortFloatVal(self), &dTrunc) ;
       
  1669 	frac = (float)dFrac;
       
  1670 #else
  1660     frac = modff(__shortFloatVal(self), &trunc);
  1671     frac = modff(__shortFloatVal(self), &trunc);
       
  1672 #endif
  1661     if (! isnan(frac)) {
  1673     if (! isnan(frac)) {
  1662 	if (__threadErrno == 0) {
  1674 	if (__threadErrno == 0) {
  1663 	    RETURN (__MKSFLOAT(frac));
  1675 	    RETURN (__MKSFLOAT(frac));
  1664 	}
  1676 	}
  1665     }
  1677     }
  1849 ! !
  1861 ! !
  1850 
  1862 
  1851 !ShortFloat class methodsFor:'documentation'!
  1863 !ShortFloat class methodsFor:'documentation'!
  1852 
  1864 
  1853 version
  1865 version
  1854     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.115 2013-01-26 15:03:23 cg Exp $'
  1866     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.116 2013-01-29 09:54:03 cg Exp $'
  1855 !
  1867 !
  1856 
  1868 
  1857 version_CVS
  1869 version_CVS
  1858     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.115 2013-01-26 15:03:23 cg Exp $'
  1870     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.116 2013-01-29 09:54:03 cg Exp $'
  1859 ! !
  1871 ! !
  1860 
  1872