#REFACTORING by exept
authorClaus Gittinger <cg@exept.de>
Wed, 27 Nov 2019 11:16:57 +0100
changeset 5307 e9b56e858f44
parent 5306 819725b85a08
child 5308 d992975959ab
#REFACTORING by exept class: PrintfScanf class changed: #absScientificPrintFloat:on:digits:
PrintfScanf.st
--- a/PrintfScanf.st	Wed Nov 27 11:16:07 2019 +0100
+++ b/PrintfScanf.st	Wed Nov 27 11:16:57 2019 +0100
@@ -967,13 +967,12 @@
     absVal := aFloat abs.
     
     "x is myself normalized to [1.0, 10.0), exp is my exponent"
-    exp := absVal < 1.0 
-                ifTrue:[
-                    (10.0 / absVal) log10 floor asInteger negated]
-                ifFalse:[
-                    absVal log10 floor asInteger].
-                    
-    x := exp == 0 ifTrue:[absVal] ifFalse:[absVal / (10.0 raisedTo:exp)].
+    absVal < 1.0 ifTrue:[
+        exp := (10.0 / absVal) log10 floor asInteger negated
+    ] ifFalse:[
+        exp := absVal log10 floor asInteger
+    ].
+    exp == 0 ifTrue:[x := absVal] ifFalse:[x := absVal / (10.0 raisedTo:exp)].
     "round the last digit to be printed"
     fuzz := 10.0 raisedTo:1 - digits.
     fuzz = 0 ifTrue:[