# Section 8.12.1.21:
$REAL

pi : NTP ; -- This feature is the closest possible approximation to the numeric -- value of pi. e : NTP ; -- This feature is the closest possible approximation to the numeric -- value of the base of natural logarithms. sqrt_2 : NTP ; -- This feature is the closest possible approximation to the square -- root of 2. log_2 : NTP ; -- This feature is the closest possible approximation to the natural -- logarithm of 2. log2_e : NTP ; -- This feature is the closest possible approximation to the value of e -- to the natural logarithm of 2. log10_e : NTP ; -- This feature is the closest possible approximation to the value of e -- to the natural logarithm of 10. log_10 : NTP ; -- This feature is the closest possible approximation to the natural -- logarithm of 10. half_pi : NTP ; -- This feature is the closest possible approximation to the numeric -- value of pi divided by two. Note that the result of adding this value to -- itself or of multiplying it by two are not necessarily the same value as -- pi due to the approximate nature of floating point arithmetic. quarter_pi : NTP ; -- This feature is the closest possible approximation to the numeric -- value of pi divided by four. Note that the result of adding this value to -- itself three times or of multiplying it by four are not necessarily the -- same value as pi due to the approximate nature of floating point -- arithmetic. inv_sqrt_2 : NTP ; -- This feature is the closest possible approximation to the numeric -- inverse of the square root of two. Note that the result if multiplying -- this by the square root of two is not necessarily unity due to the -- approximate nature of floating point arithmetic. inv_pi : NTP ; -- This feature is the closest possible approximation to the numeric -- inverse of pi. Note that the result if multiplying this by pi is not -- necessarily unity due to the approximate nature of floating point -- arithmetic. double_inv_pi : NTP ; -- This feature is the closest possible approximation to twice the -- numeric inverse of pi. Note that the result if multiplying this by twice -- pi is not necessarily unity due to the approximate nature of floating point -- arithmetic. double_sqrt_pi : NTP ; -- This feature is the closest possible approximation to twice the -- numeric inverse of the square root of pi. Note that the result is not -- necessarily the same as the result of calculation given the value pi -- and the square root operation due to the approximate nature of floating -- point arithmetic. half : NTP ; -- This feature is the closest possible representation to the value of -- a half (1/2). Note that this may or may not be exact dependent upon -- which of the implementation options has been chosen by an implementer. is_integral : BOOL ; -- This feature returns true if and only if self is a whole number. It -- is implementation defined whether or note such a number whould be -- representable in classes inheriting from $LIMITED. scale_by( exp : INT ) : SAME ; -- This feature scales the value of self by the given factor, so that -- the result is self * 2.pow(exp)

| Language Index |  | Library Index |  | Numeric Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Wednesday, 21 February 2001. |