checkin from browser
authorClaus Gittinger <cg@exept.de>
Thu, 12 Aug 1999 10:53:26 +0200
changeset 4592 f68de0746dab
parent 4591 64d6624dae5e
child 4593 1023fa0c779e
checkin from browser
Float.st
--- a/Float.st	Thu Aug 12 10:46:07 1999 +0200
+++ b/Float.st	Thu Aug 12 10:53:26 1999 +0200
@@ -882,7 +882,7 @@
     ^ (((self basicAt:8) bitAnd:16r1F) bitShift:24) +
       ((self basicAt:7) bitShift:16) +
       ((self basicAt:6) bitShift:8) +
-      (self basicAt:5)
+      (((self basicAt:5) + (self basicAt:1) + (self basicAt:2)) bitAnd:16rFF)
 
     "
      3 hash       
@@ -1407,6 +1407,23 @@
         ^ self elementBoundsError
     ].
     ^ self subscriptBoundsError:index
+!
+
+basicSize
+    "return the size in bytes of the float.
+
+     Notice: 
+        the need to redefine this method here is due to the
+        inability of many machines to store floats in non-double aligned memory.
+        Therefore, on some machines, the first 4 bytes of a float are left unused,
+        and the actual float is stored at index 5 .. 12.
+        To hide this at one place, this method knows about that, and returns
+        values as if this filler wasnt present."
+
+%{  /* NOCONTEXT */
+
+    RETURN (__MKSMALLINT(sizeof(double)));
+%}.
 ! !
 
 !Float methodsFor:'special access'!
@@ -1908,6 +1925,6 @@
 !Float class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.97 1999-08-12 08:45:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.98 1999-08-12 08:53:26 cg Exp $'
 ! !
 Float initialize!