ShortFloat.st
changeset 12629 2683b8a14a8c
parent 12628 200526f05728
child 12915 d80685e8f20e
equal deleted inserted replaced
12628:200526f05728 12629:2683b8a14a8c
   352       IEEE float format. Need more here, when porting ST/X to 370's)
   352       IEEE float format. Need more here, when porting ST/X to 370's)
   353     "
   353     "
   354     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   354     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   355 
   355 
   356     UninterpretedBytes isBigEndian ifFalse:[
   356     UninterpretedBytes isBigEndian ifFalse:[
   357 	"swap the bytes"
   357         "swap the bytes"
   358 	8 to:4 by:-1 do:[:i |
   358         4 to:1 by:-1 do:[:i |
   359 	    aFloat basicAt:i put:(aStream next)
   359             aFloat basicAt:i put:(aStream next)
   360 	].
   360         ].
   361 	^ self
   361         ^ self
   362     ].
   362     ].
   363     1 to:4 do:[:i |
   363     1 to:4 do:[:i |
   364 	aFloat basicAt:i put:aStream next
   364         aFloat basicAt:i put:aStream next
   365     ]
   365     ]
   366 
   366 
   367     "not part of libboss, as this is also used by others (TIFFReader)"
   367     "not part of libboss, as this is also used by others (TIFFReader)"
   368 
   368 
   369     "Modified: / 23-08-2006 / 16:01:52 / cg"
   369     "Modified: / 23-08-2006 / 16:01:52 / cg"
   383       IEEE float format. Need more here, when porting ST/X to 370's)
   383       IEEE float format. Need more here, when porting ST/X to 370's)
   384     "
   384     "
   385     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   385     self isIEEEFormat ifFalse:[self error:'unsupported operation'].
   386 
   386 
   387     UninterpretedBytes isBigEndian ifFalse:[
   387     UninterpretedBytes isBigEndian ifFalse:[
   388 	"swap the bytes"
   388         "swap the bytes"
   389 	8 to:4 by:-1 do:[:i |
   389         4 to:1 by:-1 do:[:i |
   390 	    aStream nextPut:(float basicAt:i).
   390             aStream nextPut:(float basicAt:i).
   391 	].
   391         ].
   392 	^ self
   392         ^ self
   393     ].
   393     ].
   394     1 to:4 do:[:i |
   394     1 to:4 do:[:i |
   395 	aStream nextPut:(float basicAt:i).
   395         aStream nextPut:(float basicAt:i).
   396     ]
   396     ]
   397 
   397 
   398     "not part of libboss, as this is also used by others (TIFFReader)"
   398     "not part of libboss, as this is also used by others (TIFFReader)"
   399 
   399 
   400     "Modified: / 23-08-2006 / 16:01:55 / cg"
   400     "Modified: / 23-08-2006 / 16:01:55 / cg"
  1719 ! !
  1719 ! !
  1720 
  1720 
  1721 !ShortFloat class methodsFor:'documentation'!
  1721 !ShortFloat class methodsFor:'documentation'!
  1722 
  1722 
  1723 version
  1723 version
  1724     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.102 2009-12-18 14:40:48 cg Exp $'
  1724     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.103 2009-12-18 14:41:46 cg Exp $'
  1725 !
  1725 !
  1726 
  1726 
  1727 version_CVS
  1727 version_CVS
  1728     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.102 2009-12-18 14:40:48 cg Exp $'
  1728     ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.103 2009-12-18 14:41:46 cg Exp $'
  1729 ! !
  1729 ! !