# HG changeset patch # User Claus Gittinger # Date 1028111047 -7200 # Node ID c383bfa3dc8cb8e669d54328511ed39687d42352 # Parent 34547f06c5c77696d6a5f405377b5738b5507ea7 documentation comment diff -r 34547f06c5c7 -r c383bfa3dc8c Float.st --- a/Float.st Wed Jul 31 12:05:53 2002 +0200 +++ b/Float.st Wed Jul 31 12:24:07 2002 +0200 @@ -155,31 +155,41 @@ Also notice, that ST/X Floats are what Doubles are in ST-80 - this may change in one of the next versions (at least on machines, which provide different float - and double types in their C-compiler. + and double types in their C-compiler). + The reason for doung this was to be compatible to both Digitalk and ParcPlace smalltalk + implementations + (ParcPlace uses a 4-byte Float and an 8-byte Double class, in contrast to + Digitalk, which has an 8-byte Float class). + Thus, by providing an 8-byte Float class, code would not loose precicion (although some memory + is wasten when porting from VW). + As Digitalk is dead now, things could (should) now be made to be compatible with VW. + Notice that ST/X provides an alias called Double, and an extra ShortFloat class, which has 4-byte + instances. WARNING: - The layout of float instances is known by the runtime system and the compiler; - you may not add instance variables here. + The layout of float instances is known by the runtime system and the compiler; + you may not add instance variables here. Also, subclassing is complicated by the fact, that the VM creates floats as results of arithmetic operations (even if the operands are subclass-instances). - (It does the float-check by probing a bit in the classes flag instVar). + However, the VM does the float-check by probing a bit in the classes flag instVar; therefore, + even subclass instances can be handled by the VMs float handling code. Mixed mode arithmetic: - float op float -> float - float op fix -> float - float op integer -> float - float op float -> float + float op float -> float + float op fix -> float + float op integer -> float + float op float -> float [Class Variables:] [see also:] - Number - ShortFloat Fraction FixedPoint Integer - FloatArray DoubleArray + Number + ShortFloat Fraction FixedPoint Integer + FloatArray DoubleArray [author:] - Claus Gittinger + Claus Gittinger " ! @@ -2246,6 +2256,6 @@ !Float class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.126 2002-06-11 21:42:34 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.127 2002-07-31 10:24:07 cg Exp $' ! ! Float initialize!