#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Wed, 29 May 2019 03:51:38 +0200
changeset 24230 f51b6573478d
parent 24229 9e72879e5365
child 24231 640ee6d97772
#DOCUMENTATION by cg class: Float comment/format in: #asTrueFraction
Float.st
--- a/Float.st	Wed May 29 03:51:21 2019 +0200
+++ b/Float.st	Wed May 29 03:51:38 2019 +0200
@@ -538,7 +538,6 @@
     "Modified (comment): / 22-06-2017 / 13:44:12 / cg"
 ! !
 
-
 !Float class methodsFor:'binary storage'!
 
 readBinaryIEEEDoubleFrom:aStream
@@ -896,7 +895,6 @@
     "Modified (comment): / 27-05-2019 / 08:58:35 / Claus Gittinger"
 ! !
 
-
 !Float class methodsFor:'queries'!
 
 exponentCharacter
@@ -957,9 +955,6 @@
     ^ 2 "must be careful here, whenever ST/X is used on VAX or a 370"
 ! !
 
-
-
-
 !Float methodsFor:'arithmetic'!
 
 * aNumber
@@ -1370,7 +1365,7 @@
     |shifty sign expPart exp fraction fractionPart result zeroBitsCount|
 
     self isFinite ifFalse:[
-	^ self asMetaNumber
+        ^ self asMetaNumber
 "/        ^ self class
 "/            raise:#domainErrorSignal
 "/            receiver:self
@@ -1382,10 +1377,10 @@
     "Extract the bits of an IEEE double float "
     shifty := LargeInteger basicNew numberOfDigits:8.
     UninterpretedBytes isBigEndian ifTrue:[
-"/        shifty := ((self longWordAt: 1) bitShift: 32) + (self longWordAt: 2).
-	1 to:8 do:[:i | shifty digitAt:(9-i) put:(self basicAt:i)].
+        "/ shifty := ((self longWordAt: 1) bitShift: 32) + (self longWordAt: 2).
+        1 to:8 do:[:i | shifty digitAt:(9-i) put:(self basicAt:i)].
     ] ifFalse:[
-	1 to:8 do:[:i | shifty digitAt:i put:(self basicAt:i)].
+        1 to:8 do:[:i | shifty digitAt:i put:(self basicAt:i)].
     ].
 
     " Extract the sign and the biased exponent "
@@ -1406,19 +1401,19 @@
       the number of trailing zero bits in the fraction to minimize
       the (huge) time otherwise spent in #gcd:. "
     exp negative ifTrue: [
-	result := sign * (fraction bitShift: exp negated)
+        result := sign * (fraction bitShift: exp negated)
     ] ifFalse:[
-	zeroBitsCount := fraction lowBit - 1.
-	exp := exp - zeroBitsCount.
-	exp <= 0 ifTrue: [
-	    zeroBitsCount := zeroBitsCount + exp.
-	    "exp := 0."   " Not needed; exp not refernced again "
-	    result := sign * (fraction bitShift:zeroBitsCount negated)
-	] ifFalse: [
-	    result := Fraction
-		    numerator: (sign * (fraction bitShift: zeroBitsCount negated))
-		    denominator: (1 bitShift:exp)
-	]
+        zeroBitsCount := fraction lowBit - 1.
+        exp := exp - zeroBitsCount.
+        exp <= 0 ifTrue: [
+            zeroBitsCount := zeroBitsCount + exp.
+            "exp := 0."   " Not needed; exp not refernced again "
+            result := sign * (fraction bitShift:zeroBitsCount negated)
+        ] ifFalse: [
+            result := Fraction
+                    numerator: (sign * (fraction bitShift: zeroBitsCount negated))
+                    denominator: (1 bitShift:exp)
+        ]
     ].
 
     "Low cost validation omitted after extensive testing"
@@ -1438,6 +1433,8 @@
      Float NaN asTrueFraction
      Float infinity asTrueFraction
     "
+
+    "Modified (format): / 29-05-2019 / 03:12:55 / Claus Gittinger"
 !
 
 coerce:aNumber
@@ -2630,7 +2627,6 @@
     "Modified (comment): / 26-05-2019 / 03:12:55 / Claus Gittinger"
 ! !
 
-
 !Float methodsFor:'testing'!
 
 isFinite