Float.st
branchjv
changeset 18040 a11a12546f23
parent 18037 4cf874da38c9
parent 14931 0de2fc03f23a
child 18045 c0c600e0d3b3
equal deleted inserted replaced
18039:09806667c605 18040:a11a12546f23
   117 	((((unsigned int *)(&x))[0] == 0x00000000) && \
   117 	((((unsigned int *)(&x))[0] == 0x00000000) && \
   118 	 (((unsigned int *)(&x))[1] == 0x7FF00000))
   118 	 (((unsigned int *)(&x))[1] == 0x7FF00000))
   119 # endif
   119 # endif
   120 
   120 
   121 # ifndef isNegativeInfinity
   121 # ifndef isNegativeInfinity
   122 #  define isPositiveInfinity(x) \
   122 #  define isNegativeInfinity(x) \
   123 	((((unsigned int *)(&x))[0] == 0x00000000) && \
   123 	((((unsigned int *)(&x))[0] == 0x00000000) && \
   124 	 (((unsigned int *)(&x))[1] == 0xFFF00000))
   124 	 (((unsigned int *)(&x))[1] == 0xFFF00000))
   125 # endif
   125 # endif
   126 
   126 
   127 # ifndef isinf
   127 # ifndef isinf
   135 # endif
   135 # endif
   136 
   136 
   137 # define NO_ASINH
   137 # define NO_ASINH
   138 # define NO_ACOSH
   138 # define NO_ACOSH
   139 # define NO_ATANH
   139 # define NO_ATANH
       
   140 
       
   141 # ifdef __MINGW__
       
   142 #  include <string.h>
       
   143 # endif
       
   144 
   140 #endif /* WIN32 */
   145 #endif /* WIN32 */
   141 
   146 
   142 #ifdef solaris
   147 #ifdef solaris
   143 # ifndef isfinite
   148 # ifndef isfinite
   144 #  define isfinite(f) finite((double)(f))
   149 #  define isfinite(f) finite((double)(f))
   438       IEEE float format. Will need more here, when porting ST/X to 370's)
   443       IEEE float format. Will need more here, when porting ST/X to 370's)
   439     "
   444     "
   440     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   445     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   441 
   446 
   442     (UninterpretedBytes isBigEndian == msb) ifFalse:[
   447     (UninterpretedBytes isBigEndian == msb) ifFalse:[
   443         "swap the bytes"
   448 	"swap the bytes"
   444         8 to:1 by:-1 do:[:i |
   449 	8 to:1 by:-1 do:[:i |
   445             aFloat basicAt:i put:(aStream next)
   450 	    aFloat basicAt:i put:(aStream next)
   446         ].
   451 	].
   447         ^ self
   452 	^ self
   448     ].
   453     ].
   449     1 to:8 do:[:i |
   454     1 to:8 do:[:i |
   450         aFloat basicAt:i put:aStream next
   455 	aFloat basicAt:i put:aStream next
   451     ]
   456     ]
   452 
   457 
   453     "not part of libboss, as this is also used by others (TIFFReader)"
   458     "not part of libboss, as this is also used by others (TIFFReader)"
   454 
   459 
   455     "Modified: / 23-08-2006 / 16:00:37 / cg"
   460     "Modified: / 23-08-2006 / 16:00:37 / cg"
   474       IEEE float format. Need more here, when porting ST/X to 370's)
   479       IEEE float format. Need more here, when porting ST/X to 370's)
   475     "
   480     "
   476     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   481     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   477 
   482 
   478     (UninterpretedBytes isBigEndian == msb) ifFalse:[
   483     (UninterpretedBytes isBigEndian == msb) ifFalse:[
   479         "swap the bytes"
   484 	"swap the bytes"
   480         8 to:1 by:-1 do:[:i |
   485 	8 to:1 by:-1 do:[:i |
   481             aStream nextPut:(aFloat basicAt:i).
   486 	    aStream nextPut:(aFloat basicAt:i).
   482         ].
   487 	].
   483         ^ self
   488 	^ self
   484     ].
   489     ].
   485     1 to:8 do:[:i |
   490     1 to:8 do:[:i |
   486         aStream nextPut:(aFloat basicAt:i).
   491 	aStream nextPut:(aFloat basicAt:i).
   487     ].
   492     ].
   488 
   493 
   489     "not part of libboss, as this is also used by others (TIFFReader)"
   494     "not part of libboss, as this is also used by others (TIFFReader)"
   490 
   495 
   491     "Modified: / 23-08-2006 / 16:00:47 / cg"
   496     "Modified: / 23-08-2006 / 16:00:47 / cg"
  2865 ! !
  2870 ! !
  2866 
  2871 
  2867 !Float class methodsFor:'documentation'!
  2872 !Float class methodsFor:'documentation'!
  2868 
  2873 
  2869 version
  2874 version
  2870     ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.190 2013-03-20 15:43:49 cg Exp $'
  2875     ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.191 2013-03-22 09:44:22 cg Exp $'
  2871 !
  2876 !
  2872 
  2877 
  2873 version_CVS
  2878 version_CVS
  2874     ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.190 2013-03-20 15:43:49 cg Exp $'
  2879     ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.191 2013-03-22 09:44:22 cg Exp $'
  2875 ! !
  2880 ! !
  2876 
  2881 
  2877 
  2882 
  2878 Float initialize!
  2883 Float initialize!