Number.st
changeset 16406 967b6c76169a
parent 16267 beef1cb9c801
child 16450 9a81e708b188
--- a/Number.st	Wed May 07 16:31:21 2014 +0200
+++ b/Number.st	Wed May 07 16:32:05 2014 +0200
@@ -437,6 +437,7 @@
     "
 ! !
 
+
 !Number class methodsFor:'constants'!
 
 decimalPointCharacter 
@@ -665,6 +666,7 @@
     "Modified: / 16.11.2001 / 14:13:16 / cg"
 ! !
 
+
 !Number class methodsFor:'private'!
 
 readMantissaAndScaleFrom:aStream radix:radix
@@ -739,6 +741,7 @@
     ^ self == Number
 ! !
 
+
 !Number methodsFor:'*StateSpecs-Specs'!
 
 isEqual: aNumber within: accuracy 
@@ -867,10 +870,6 @@
     ^ self degreesToRadians tan
 !
 
-newTileMorphRepresentative
-        ^ TileMorph new addArrows; setLiteral: self; addSuffixIfCan
-!
-
 rounded:n
     "Answer the float rounded with n digits of precision"
 
@@ -894,6 +893,8 @@
     ^ self rounded printString
 ! !
 
+
+
 !Number methodsFor:'coercing & converting'!
 
 i
@@ -1144,6 +1145,25 @@
     "Created: / 05-09-2011 / 11:17:59 / cg"
 ! !
 
+!Number methodsFor:'double dispatching'!
+
+differenceFromTimestamp:aTimestamp
+    "I am to be interpreted as seconds, return the timestamp this number of seconds
+     before aTimestamp"
+
+    ^ aTimestamp subtractMilliseconds:(self * 1000) truncated.
+
+    "
+     Timestamp now differenceFromTimestamp:aTimestamp   
+     100.0 differenceFromTimestamp:Timestamp now 
+
+     |t1 t2|
+     t1 := Timestamp now. 
+     t2 := 1.5 differenceFromTimestamp:t1.
+     t1 inspect. t2 inspect.
+    "
+! !
+
 !Number methodsFor:'intervals'!
 
 downTo:stop
@@ -2356,13 +2376,14 @@
     "Modified: / 5.11.2001 / 17:54:22 / cg"
 ! !
 
+
 !Number class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.146 2014-03-18 10:07:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.147 2014-05-07 14:32:05 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.146 2014-03-18 10:07:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.147 2014-05-07 14:32:05 stefan Exp $'
 ! !