OctaFloat.st
changeset 5327 9cecf32b06e2
parent 5294 dcfaed4ae26f
child 5338 05801efc9fb3
--- a/OctaFloat.st	Sun Dec 01 05:25:38 2019 +0100
+++ b/OctaFloat.st	Sun Dec 01 05:26:12 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "{ Package: 'stx:libbasic2' }"
 
 "{ NameSpace: Smalltalk }"
@@ -285,7 +283,7 @@
 !OctaFloat class methodsFor:'coercing & converting'!
 
 coerce:aNumber
-    "convert the argument aNumber into an instance of the receiver's class and return it."
+    "convert the argument aNumber into an instance of the receiver (class) and return it."
 
     ^ aNumber asOctaFloat.
 
@@ -1029,6 +1027,20 @@
     "
 !
 
+asIEEEFloat
+    "return an IEEE soft float with same value as receiver"
+
+    ^ IEEEFloat fromFloat:self
+
+    "
+     123 asFloat asIEEEFloat
+     0 asShortFloat asIEEEFloat
+     0 asLongFloat asIEEEFloat
+     0 asOctaFloat asIEEEFloat
+     0.0 asIEEEFloat
+    "
+!
+
 asOctaFloat
     ^ self
 
@@ -1040,7 +1052,7 @@
 generality
     "return the generality value - see ArithmeticValue>>retry:coercing:"
 
-    ^ 93
+    ^ 96
 
     "Created: / 07-06-2019 / 09:30:58 / Claus Gittinger"
 ! !