LimitedPrecisionReal.st
changeset 17380 c8f2a7e0edbd
parent 17221 1ee235ddab7f
child 17655 b8f27b84fda3
--- a/LimitedPrecisionReal.st	Tue Feb 03 14:57:05 2015 +0100
+++ b/LimitedPrecisionReal.st	Tue Feb 03 15:15:52 2015 +0100
@@ -13,6 +13,8 @@
 "
 "{ Package: 'stx:libbasic' }"
 
+"{ NameSpace: Smalltalk }"
+
 Number subclass:#LimitedPrecisionReal
 	instanceVariableNames:''
 	classVariableNames:''
@@ -1153,6 +1155,7 @@
 ! !
 
 
+
 !LimitedPrecisionReal methodsFor:'printing & storing'!
 
 printOn:aStream
@@ -1308,6 +1311,21 @@
     ^ self sign >= 0
 
     "Modified: 17.4.1996 / 13:35:10 / cg"
+!
+
+sign
+    "return the sign of the receiver (-1, 0 or 1)"
+
+    self strictlyPositive  ifTrue:[^ 1].
+    self negative ifTrue:[^ -1].
+    ^ 0
+
+    "
+        -1.0 sign
+        -0.0 sign
+        1.0 sign
+        0.0 sign
+    "
 ! !
 
 !LimitedPrecisionReal methodsFor:'truncation & rounding'!
@@ -1352,11 +1370,11 @@
 !LimitedPrecisionReal class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.81 2014-12-16 12:20:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.82 2015-02-03 14:15:52 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.81 2014-12-16 12:20:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.82 2015-02-03 14:15:52 stefan Exp $'
 ! !