#FEATURE by exept
class: LongFloat
class definition
class: LongFloat class
added: #phi
--- a/LongFloat.st Wed Nov 20 16:33:31 2019 +0100
+++ b/LongFloat.st Wed Nov 20 16:33:50 2019 +0100
@@ -19,7 +19,7 @@
instanceVariableNames:''
classVariableNames:'DefaultPrintFormat DefaultPrintfFormat LongFloatZero LongFloatOne
Pi E Epsilon NaN PositiveInfinity NegativeInfinity Halfpi
- HalfpiNegative'
+ HalfpiNegative Phi'
poolDictionaries:''
category:'Magnitude-Numbers'
!
@@ -570,6 +570,19 @@
"Modified (comment): / 09-06-2019 / 12:53:25 / Claus Gittinger"
!
+phi
+ "return the constant phi as LongFloat"
+
+ Phi isNil ifTrue:[
+ "/ phiDigits has enough digits for 128bit IEEE quads
+ "/ do not use as a literal constant here - we cannot depend on the underlying C-compiler here...
+ Phi := self readFrom:(Number phiDigits)
+ ].
+ ^ Phi
+
+ "Modified (format): / 06-06-2019 / 17:10:22 / Claus Gittinger"
+!
+
pi
"return the constant pi as LongFloat"