x
authorClaus Gittinger <cg@exept.de>
Tue, 13 Jun 2017 16:50:06 +0200
changeset 4381 03b8f1691a02
parent 4380 1f4fe7f1c1d3
child 4382 b0b3e4b6e61e
x
extensions.st
--- a/extensions.st	Tue Jun 13 09:01:30 2017 +0200
+++ b/extensions.st	Tue Jun 13 16:50:06 2017 +0200
@@ -1,5 +1,19 @@
 "{ Package: 'stx:libbasic2' }"!
 
+!ArithmeticValue methodsFor:'converting'!
+
+asQDouble
+    "return a QDouble with same value"
+
+    ^ self asFloat asQDouble
+
+    "
+     123 asQDouble
+    "
+
+    "Created: / 13-06-2017 / 16:48:24 / cg"
+! !
+
 !ArithmeticValue methodsFor:'double dispatching'!
 
 differenceFromQDouble:aQDouble
@@ -883,6 +897,20 @@
     q printOn:aStream
 ! !
 
+!Float methodsFor:'coercing & converting'!
+
+asQDouble
+    "return a QDouble with my value"
+
+    ^ QDouble fromFloat:self
+
+    "
+     1.0 asQDouble
+    "
+
+    "Created: / 13-06-2017 / 16:48:57 / cg"
+! !
+
 !Object methodsFor:'dependents-interests'!
 
 addInterest:anInterest