#FEATURE by exept
authorClaus Gittinger <cg@exept.de>
Wed, 20 Nov 2019 16:32:58 +0100
changeset 24930 b9f4cb048fe7
parent 24929 ebd235e61981
child 24931 843e3aaea193
#FEATURE by exept class: Float class definition class: Float class added: #phi #sqrt5
Float.st
--- a/Float.st	Tue Nov 19 17:29:21 2019 +0100
+++ b/Float.st	Wed Nov 20 16:32:58 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -525,7 +527,6 @@
     DefaultPrintfFormat := something.
 ! !
 
-
 !Float class methodsFor:'binary storage'!
 
 readBinaryIEEEDoubleFrom:aStream
@@ -808,6 +809,17 @@
     "Modified (comment): / 09-06-2019 / 12:55:10 / Claus Gittinger"
 !
 
+phi
+    "return the constant phi as Float"
+
+    "/ don't expect this many valid digits on all machines;
+    "/ The actual precision is very CPU specific.
+
+    ^ 1.618033988749894848204586834365638117720309179805762862135
+
+
+!
+
 pi
     "return the constant pi as Float"
 
@@ -828,6 +840,15 @@
     "Created: / 07-06-2007 / 21:12:33 / cg"
 !
 
+sqrt5
+    "/ don't expect this many valid digits on all machines;
+    "/ The actual precision is very CPU specific.
+
+    ^ 2.236067977499789696409173668731276235440618359611525724270
+
+    "Created: / 07-06-2007 / 21:12:33 / cg"
+!
+
 unity
     "return the neutral element for multiplication (1.0) as Float"
 
@@ -889,7 +910,6 @@
     "Modified (comment): / 27-05-2019 / 08:58:35 / Claus Gittinger"
 ! !
 
-
 !Float class methodsFor:'queries'!
 
 epsilon
@@ -978,7 +998,6 @@
     "Modified (comment): / 19-07-2019 / 17:28:11 / Claus Gittinger"
 ! !
 
-
 !Float methodsFor:'arithmetic'!
 
 * aNumber
@@ -2691,7 +2710,6 @@
     "Modified (comment): / 26-05-2019 / 03:12:55 / Claus Gittinger"
 ! !
 
-
 !Float methodsFor:'testing'!
 
 isFinite