#OTHER by mawalch
authormawalch
Wed, 24 May 2017 22:28:18 +0200
changeset 21771 2264c7d8e15b
parent 21770 02cbb05d3aa4
child 21772 04a96a4b3c45
#OTHER by mawalch Spelling fixes.
LimitedPrecisionReal.st
--- a/LimitedPrecisionReal.st	Tue May 23 16:21:50 2017 +0200
+++ b/LimitedPrecisionReal.st	Wed May 24 22:28:18 2017 +0200
@@ -40,50 +40,50 @@
 
 documentation
 "
-    Abstract superclass for any-precision floating point numbers (i.e. IEE floats and doubles).
+    Abstract superclass for any-precision floating point numbers (i.e. IEEE floats and doubles).
 
     Due to historic reasons, ST/X's Floats are what Doubles are in ST-80.
-    The reason is that in some Smalltalk's, double floats are called Float, and no single float exists (VSE, V'Age),
+    The reason is that in some Smalltalks, double floats are called Float, and no single float exists (VSE, V'Age),
     whereas in others, there are both Float and Double classes (VisualWorks).
     In order to allow code from both families to be loaded into ST/X without a missing class error,
-    we decided to use IEE doubles as the internal representation of Float and make Double an alias to it.
+    we decided to use IEEE doubles as the internal representation of Float and make Double an alias to it.
     This should work for either family.
     If you really only want single precision floating point numbers, use ShortFloat instances.
-    But be aware, that there is usually no advantage (neither in memory usage, due to memory alignment restrictions),
-    nor in speed, as these days, the CPUs are just as fast doing double precision operations.
+    But be aware that there is usually no advantage (neither in memory usage, due to memory alignment restrictions,
+    nor in speed), as these days, the CPUs are just as fast doing double precision operations.
     (There is a difference when doing bulk operations, and you should consider using FloatArray for those).
 
     Range and Precision of Storage Formats:
     =======================================
 
-      Format |   Class    |   Array Class   | Bits / Significant  | Smallest Pos Number | Largest Pos Number | Significant Digits 
+      Format |   Class    |   Array Class   | Bits / Significant  | Smallest Pos Number | Largest Pos Number | Significant Digits
              |            |                 |      (Binary)       |                     |                    |     (Decimal)
-      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------    
+      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------
       half   |     --     | HalfFloatArray  |    16 / 11          |  6.10... x 10−5     |  6.55...  x 10+5   |      3.3
-      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------    
+      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------
       single | ShortFloat | FloatArray      |    32 / 24          |  1.175...x 10-38    |  3.402... 10+38    |      6-9
-      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------    
+      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------
       double | Float      | DoubleArray     |    64 / 53          |  2.225...x 10-308   |  1.797... 10+308   |     15-17
-      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------    
+      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------
       double | LongFloat  |     --          |   128 / 113         |  3.362...x 10-4932  |  1.189... 10+4932  |     33-36
       ext    |            |                 |                     |                     |                    |
       (SPARC)|            |                 |                     |                     |                    |
-      -------+            |                 |---------------------+---------------------+--------------------+--------------------    
+      -------+            |                 |---------------------+---------------------+--------------------+--------------------
       double |            |                 |    96 / 64          |  3.362...x 10-4932  |  1.189... 10+4932  |     18-21
       ext    |            |                 |                     |                     |                    |
       (x86)  |            |                 |                     |                     |                    |
-      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------    
+      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------
         --   | LargeFloat |     --          |     arbitrary       |  arbitrarily small  |  arbitrarily large |     arbitrary
-      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------    
+      -------+------------+-----------------+---------------------+---------------------+--------------------+--------------------
 
     HalfFloats are only supported in fixed array containers. This was added for OpenGL and other graphic libraries which allow
     for texture, and vertex data to be passed quickly in that format (see http://www.opengl.org/wiki/Small_Float_Formats).
-    Long- and LargeFloat are not supported as array containers. 
+    Long- and LargeFloat are not supported as array containers.
     These formats are seldom used for bulk data.
 
     Bulk Containers:
     ================
-    If you have a vector or matrix (and especially: large one's) of floating point numbers, the well known
+    If you have a vector or matrix (and especially: large ones) of floating point numbers, the well known
     Array is a very inperformant choice. The reason is that it keeps pointers to each of its elements, and each element
     (if it is a float) is itself stored somewhere in the object memory.
     Thus, there is both a space overhead (every float object has an object header, for class and other information), and
@@ -91,7 +91,7 @@
     For this, the bulk numeric containers are provided, which keep the elements unboxed and properly aligned.
     Use them for matrices and large numeric vectors. They also provide some optimized bulk operation methods,
     such as adding, multiplying etc.
-    
+
     Comparing Floats:
     =================
     Due to rounding errors (usually on the last bit), you shalt not compare two floating point numbers
@@ -103,13 +103,13 @@
 
     Also, comparing against a proper 1.0 (which is representable as an exact power of 2), you will get a false result.
     (i.e. 0.1 * 10 ~= 1.0)
-    This often confuses non-computer scientists (and even some of those are ocasionally).
+    This often confuses non-computer scientists (and occasionally even some of those).
     For this, you should always provide an epsilon value, when comparing two numbers. The epsilon value is
     the distance you accept two number to be apart to be still considered equal. Effectively the epsilon says
     are those nearer than this epsilon?.
     Now we could say is the delta between two numbers smaller than 0.00001,
     and get a reasonable answer for big numbers. But what if we compare two tiny numbers?
-    Then a reasonable epsilon must also be much smaller. 
+    Then a reasonable epsilon must also be much smaller.
     Actually, the epsilon should always be computed dynamically depending on the two values compared.
     That is what the #isAlmostEqualTo:nEpsilon: method does for you. It does not take an absolute epsilon,
     but instead the number of distinct floating point numbers that the two compared floats may be apart.