FixedPoint.st
changeset 2140 5e2def558185
parent 1898 883a1046ca9a
child 2538 6bbfd3558458
--- a/FixedPoint.st	Fri Jan 10 19:43:15 1997 +0100
+++ b/FixedPoint.st	Fri Jan 10 19:55:31 1997 +0100
@@ -207,25 +207,6 @@
     "Return the number of places of significance that is carried by the receiver."
 
     ^ scale
-!
-
-withScale:newScale
-    "Return a copy of the receiver, with newScale number of post-decimal
-     digits"
-
-    ^ self class
-        numerator:numerator
-        denominator:denominator
-        scale:newScale
-
-    "
-     (Fixed fromString:'12345.12345') withScale:2 
-
-     ((Fixed fromString:'0.33333333')
-      + 
-      (Fixed fromString:'0.33333333')
-     ) withScale:2   
-    "
 ! !
 
 !FixedPoint methodsFor:'arithmetic'!
@@ -562,10 +543,32 @@
 !FixedPoint methodsFor:'coercing & converting'!
 
 asFixedPoint
-    "return the receiver as a fixedPoint number"
+    "return the receiver as a fixedPoint number - thats the receiver itself"
 
     ^ self
 
+    "Modified: 10.1.1997 / 19:53:14 / cg"
+!
+
+asFixedPoint:newScale
+    "Return a copy of the receiver, with newScale number of post-decimal
+     digits"
+
+    ^ self class
+        numerator:numerator
+        denominator:denominator
+        scale:newScale
+
+    "
+     (FixedPoint fromString:'12345.12345') asFixedPoint:2 
+
+     ((FixedPoint fromString:'0.33333333')
+      + 
+      (FixedPoint fromString:'0.33333333')
+     ) asFixedPoint:2   
+    "
+
+    "Modified: 10.1.1997 / 19:52:25 / cg"
 !
 
 asFraction
@@ -609,6 +612,24 @@
      1.0 asShortFloat + (FixedPoint fromString:'1.001')
      1 asLargeInteger + (FixedPoint fromString:'1.001')
     "
+!
+
+withScale:newScale
+    "Return a copy of the receiver, with newScale number of post-decimal
+     digits"
+
+    ^ self asFixedPoint:newScale
+
+    "
+     (FixedPoint fromString:'12345.12345') withScale:2 
+
+     ((FixedPoint fromString:'0.33333333')
+      + 
+      (FixedPoint fromString:'0.33333333')
+     ) withScale:2   
+    "
+
+    "Modified: 10.1.1997 / 19:52:54 / cg"
 ! !
 
 !FixedPoint methodsFor:'double dispatching'!
@@ -823,5 +844,5 @@
 !FixedPoint class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.5 1996-11-05 19:45:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.6 1997-01-10 18:55:31 cg Exp $'
 ! !