comments
authorClaus Gittinger <cg@exept.de>
Tue, 17 Jun 2003 16:35:41 +0200
changeset 7405 9b0334a4591b
parent 7404 670c6dee957f
child 7406 47324e62cca2
comments
Float.st
LargeInteger.st
LimitedPrecisionReal.st
LongFloat.st
ShortFloat.st
--- a/Float.st	Tue Jun 17 16:12:12 2003 +0200
+++ b/Float.st	Tue Jun 17 16:35:41 2003 +0200
@@ -184,7 +184,13 @@
         float op longFloat   -> longFloat
         float op complex     -> complex
 
-    [Class Variables:]
+    Representation:
+            64bit double precision IEE floats
+            53 bit mantissa,
+            11 bit exponent,
+            15 decimal digits (approx)
+
+    Range and Precision of Storage Formats: see LimitedPrecisionReal >> documentation
 
     [author:]
         Claus Gittinger
@@ -2466,7 +2472,7 @@
 !Float class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.140 2003-06-17 14:09:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.141 2003-06-17 14:35:09 cg Exp $'
 ! !
 
 Float initialize!
--- a/LargeInteger.st	Tue Jun 17 16:12:12 2003 +0200
+++ b/LargeInteger.st	Tue Jun 17 16:35:41 2003 +0200
@@ -1118,8 +1118,8 @@
 
 asFloat:floatClass
     "return a float with same value as myself.
-     Since longFloats have a limited precision, you usually loose bits when
-     doing this."
+     Since floats have a limited precision, you usually loose bits when doing this
+     (see Float decimalPrecision, LongFloat decimalPrecision."
 
     |newFloat|
 
@@ -1138,11 +1138,17 @@
      1234567890 asFloat                     
      1234567890 asFloat asInteger                    
 
-     12345678901234567890 asFloat           
-     12345678901234567890 asFloat asInteger 
+     12345678901234567890 asFloat             
+     12345678901234567890 asFloat asInteger   
 
      12345678901234567890 asLongFloat           
      12345678901234567890 asLongFloat asInteger 
+
+     123456789012345678901234567890 asLongFloat           
+     123456789012345678901234567890 asLongFloat asInteger  
+
+     1234567890123456789012345678901234567890 asLongFloat           
+     1234567890123456789012345678901234567890 asLongFloat asInteger  
     "
 !
 
@@ -4441,5 +4447,5 @@
 !LargeInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.169 2003-06-16 09:16:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.170 2003-06-17 14:35:35 cg Exp $'
 ! !
--- a/LimitedPrecisionReal.st	Tue Jun 17 16:12:12 2003 +0200
+++ b/LimitedPrecisionReal.st	Tue Jun 17 16:35:41 2003 +0200
@@ -37,12 +37,29 @@
 
 documentation
 "
-    Abstract superclass for single and double (and maybe more) 
-    precision real numbers (i.e. Float and Double).
+    Abstract superclass for any-precision floating point numbers (i.e. Float and Double).
 
     Due to historic reasons, ST/X's Floats are what Doubles are in ST-80.
     This may change soon (implementing LPReal is a first step towards this).
 
+    Range and Precision of Storage Formats:
+
+      Format |     Class  | Significant Digits (Binary) | Smallest Pos Number | Largest Pos Number | Significant Digits (Decimal)
+      -------+------------+-----------------------------+---------------------+--------------------+------------------------------    
+      single | ShortFloat |         24                  |  1.175... 10-38     |  3.402... 10+38    |      6-9
+      -------+------------+-----------------------------+---------------------+--------------------+------------------------------    
+      double | Float      |         53                  |  2.225... 10-308    |  1.797... 10+308   |     15-17
+      -------+------------+-----------------------------+---------------------+--------------------+------------------------------    
+      double | LongFloat  |        113                  |  3.362... 10-4932   |  1.189... 10+4932  |     33-36
+      ext    |            |                             |                     |                    |
+      (SPARC)|            |                             |                     |                    |
+      -------+            |-----------------------------+---------------------+--------------------+------------------------------    
+      double |            |         64                  |  3.362... 10-4932   |  1.189... 10+4932  |     18-21
+      ext    |            |                             |                     |                    |
+      (x86)  |            |                             |                     |                    |
+      -------+------------+-----------------------------+---------------------+--------------------+------------------------------    
+
+
     [author:]
         Claus Gittinger
 
@@ -936,7 +953,7 @@
 !LimitedPrecisionReal class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.53 2003-06-17 14:10:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.54 2003-06-17 14:35:32 cg Exp $'
 ! !
 
 LimitedPrecisionReal initialize!
--- a/LongFloat.st	Tue Jun 17 16:12:12 2003 +0200
+++ b/LongFloat.st	Tue Jun 17 16:35:41 2003 +0200
@@ -183,7 +183,7 @@
     mapped to the IEE extended float or IEE quad float format.
  
     In contrast to Floats (which use the C-compilers 64bit 'double' format),
-    LongFloats give you 80, 96 bit floats (extended) or 128 bit floats (quad).
+    LongFloats give you 80 bit floats (extended) or 128 bit floats (quad).
     The actual number of bits depends on the underlying CPU
     (thus, longFloat code is not quaranteed to be portable).
  
@@ -200,9 +200,9 @@
  
         gcc-sparc:
             128bit quad IEE floats (16bytes);
-            64 bit mantissa,
+            112 bit mantissa,
             16 bit exponent,
-            19 decimal digits (approx)
+            34 decimal digits (approx)
  
     Mixed mode arithmetic:
         longFloat op longFloat   -> longFloat
@@ -213,6 +213,8 @@
         longFloat op float       -> longFloat
         longFloat op complex     -> complex
  
+    Range and Precision of Storage Formats: see LimitedPrecisionReal >> documentation
+
     [author:]
         Claus Gittinger
  
@@ -2147,7 +2149,7 @@
 !LongFloat class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.35 2003-06-17 14:11:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.36 2003-06-17 14:35:30 cg Exp $'
 ! !
 
 LongFloat initialize!
--- a/ShortFloat.st	Tue Jun 17 16:12:12 2003 +0200
+++ b/ShortFloat.st	Tue Jun 17 16:35:41 2003 +0200
@@ -132,6 +132,14 @@
         shortFloat op float       -> float
         shortFloat op complex     -> complex
 
+    Representation:
+            32bit single precision IEE floats
+            23 bit mantissa,
+            8 bit exponent,
+            6 decimal digits (approx)
+
+    Range and Precision of Storage Formats: see LimitedPrecisionReal >> documentation
+
     [author:]
         Claus Gittinger
 
@@ -1475,5 +1483,5 @@
 !ShortFloat class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.75 2003-06-17 14:11:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.76 2003-06-17 14:35:41 cg Exp $'
 ! !