class: LimitedPrecisionReal
authorClaus Gittinger <cg@exept.de>
Wed, 25 Mar 2015 18:56:15 +0100
changeset 17663 341b07be4e1b
parent 17662 0fd098ccf3ff
child 17664 9f921fb412cd
class: LimitedPrecisionReal added: #fmin #emin #fmax
LimitedPrecisionReal.st
--- a/LimitedPrecisionReal.st	Wed Mar 25 18:54:48 2015 +0100
+++ b/LimitedPrecisionReal.st	Wed Mar 25 18:56:15 2015 +0100
@@ -403,9 +403,12 @@
 emin
     "return the smallest exponent"
 
-    self subclassResponsibility
+    ^ self subclassResponsibility
 
-    "Created: / 7.9.2001 / 14:05:35 / cg"
+    "
+     Float emin  
+     ShortFloat emin  
+    "
 !
 
 epsilon
@@ -421,19 +424,26 @@
 !
 
 fmax
-    "return the largest value allowed"
+    "The largest value allowed by instances of this class."
+
+    |radix|
 
-    self subclassResponsibility
+    radix := self radix.
+    ^(self fromNumber: 1) -
+            ((self fromNumber: radix) timesTwoPower: self precision negated - 1) * radix
+            * ((self fromNumber: radix) timesTwoPower: self emax - 1)
 
-    "Created: / 7.9.2001 / 14:06:56 / cg"
+    "
+     Float fmax    
+     ShortFloat fmax 
+     LongFloat fmax  
+    "
 !
 
 fmin
-    "return the minimum value allowed"
+    "The smallest value allowed by instances of this class."
 
-    self subclassResponsibility
-
-    "Created: / 7.9.2001 / 14:07:06 / cg"
+    ^ self subclassResponsibility
 !
 
 infinity
@@ -1078,7 +1088,6 @@
     "Modified: 17.4.1996 / 13:34:50 / cg"
 ! !
 
-
 !LimitedPrecisionReal methodsFor:'copying'!
 
 deepCopy
@@ -1372,11 +1381,11 @@
 !LimitedPrecisionReal class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.83 2015-03-25 17:17:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.84 2015-03-25 17:56:15 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.83 2015-03-25 17:17:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.84 2015-03-25 17:56:15 cg Exp $'
 ! !