extensions.st
changeset 4381 03b8f1691a02
parent 4379 e547154fa694
child 4383 e0bff32f8dd2
--- 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