ByteArray.st
changeset 3202 22d6d81d2109
parent 3135 8c0f47cf59e3
child 3205 86ad9ad5e29c
--- a/ByteArray.st	Wed Jan 21 14:57:19 1998 +0100
+++ b/ByteArray.st	Wed Jan 21 15:19:50 1998 +0100
@@ -411,8 +411,11 @@
      float representation - if the bytearray originated from another
      machine, some conversion is usually needed."
 
+    |flt|
+
+    flt := aFloat asFloat.
     1 to:8 do:[:srcIndex|
-	self at:index - 1 + srcIndex put:(aFloat basicAt:srcIndex)
+        self at:index - 1 + srcIndex put:(flt basicAt:srcIndex)
     ].
     ^ aFloat
 !
@@ -645,15 +648,9 @@
 
     |newFloat|
 
-    newFloat := Float basicNew.
-    UninterpretedBytes isBigEndian ifFalse:[
-	5 to:8 do:[:destIndex|
-	    newFloat basicAt:destIndex put:(self at:index - 5 + destIndex)
-	].
-    ] ifTrue:[
-	1 to:4 do:[:destIndex|
-	    newFloat basicAt:destIndex put:(self at:index - 1 + destIndex)
-	].
+    newFloat := ShortFloat basicNew.
+    1 to:4 do:[:destIndex|
+        newFloat basicAt:destIndex put:(self at:index - 1 + destIndex)
     ].
     ^ newFloat.
 !
@@ -666,14 +663,11 @@
      float representation - if the bytearray originated from another
      machine, some conversion is usually needed."
 
-    UninterpretedBytes isBigEndian ifFalse:[
-	5 to:8 do:[:srcIndex|
-	    self at:index - 5 + srcIndex put:(aFloat basicAt:srcIndex)
-	].
-    ] ifTrue:[
-	1 to:4 do:[:srcIndex|
-	    self at:index - 1 + srcIndex put:(aFloat basicAt:srcIndex)
-	].
+    |sflt|
+
+    sflt := aFloat asShortFloat.
+    1 to:4 do:[:srcIndex|
+        self at:index - 1 + srcIndex put:(sflt basicAt:srcIndex)
     ].
     ^ aFloat
 !
@@ -2383,5 +2377,5 @@
 !ByteArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.90 1997-12-19 08:37:05 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.91 1998-01-21 14:19:50 dq Exp $'
 ! !