#FEATURE by exept
class: QuadFloat
class definition
class: QuadFloat class
added: #phi
--- a/QuadFloat.st Tue Nov 19 15:31:59 2019 +0100
+++ b/QuadFloat.st Wed Nov 20 16:34:22 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"{ Package: 'stx:libbasic2' }"
"{ NameSpace: Smalltalk }"
@@ -5,7 +7,7 @@
LimitedPrecisionReal variableByteSubclass:#QuadFloat
instanceVariableNames:''
classVariableNames:'QuadFloatZero QuadFloatOne Pi E Epsilon NaN PositiveInfinity
- NegativeInfinity Halfpi HalfpiNegative'
+ NegativeInfinity Halfpi HalfpiNegative Phi'
poolDictionaries:''
category:'Magnitude-Numbers'
!
@@ -2470,6 +2472,19 @@
"Created: / 08-06-2019 / 14:05:50 / Claus Gittinger"
!
+phi
+ "return the constant phi as quadFloat"
+
+ 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
+
+
+!
+
pi
"return the constant pi as quadFloat"