#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Thu, 10 May 2018 14:39:53 +0200
changeset 22865 77d1d90b53bc
parent 22864 ed881ba3a4d2
child 22866 43f44339eee0
#BUGFIX by cg class: TimeDuration changed: #abs #negated
TimeDuration.st
--- a/TimeDuration.st	Thu May 10 14:25:46 2018 +0200
+++ b/TimeDuration.st	Thu May 10 14:39:53 2018 +0200
@@ -798,19 +798,28 @@
 !
 
 abs
-    timeEncoding >= 0 ifTrue:[
-        ^ self. 
-    ].
-    ^ self class new timeEncoding:(timeEncoding negated)
+    ^ self class new 
+        setMilliseconds:(self getMilliseconds abs)
+        additionalPicoseconds:(additionalPicoseconds?0) abs
 
     "
-        (TimeDuration fromSeconds:20000) abs
-        (TimeDuration fromSeconds:-20000) abs
+     (TimeDuration fromSeconds:3600) abs
+     (TimeDuration fromSeconds:-3600) abs
+
+     (TimeDuration fromSeconds:20000) abs
+     (TimeDuration fromSeconds:-20000) abs
     "
 !
 
 negated
-    ^ self class new timeEncoding:(timeEncoding negated)
+    ^ self class new 
+        setMilliseconds:(self getMilliseconds) negated
+        additionalPicoseconds:(additionalPicoseconds?0) negated
+
+    "
+     50 nanoseconds negated asNanoseconds
+     1 seconds negated asSeconds
+    "
 !
 
 productFromFloat:aFloat