Node:Global Constants and Variables, Next:Dynamic Allocation of Shapes, Previous:Typedefs and Utility Structures, Up:Top
The global constants and variables described in this chapter are
found in pspglb.web
. Others, of types
defined in 3DLDF, are described in subsequent chapters.
bool ldf_real_float  Constants 
bool ldf_real_double 
Set to 0 or 1 to match the values of the preprocessor macros
LDF_REAL_FLOAT and LDF_REAL_DOUBLE . The latter are used
for conditional compilation and determine whether real is
"typedeffed" to float or double , i.e., whether
real is made to be a synonym of float or double
using typedef .

real PI  Constant 
The value of PI
is calculated as
4.0 * arctan(1.0).
I believe that a preprocessor macro "PI " was
available when I compiled 3DLDF using the DEC C++
compiler, and that
it wasn't, when I used GNU CC under Linux, but I'm no longer sure.

valarray <real> null_coordinates  Variable 
Contains four elements, all 0. Used for resetting the sets of
coordinates belonging to Points , but only when the DEC C++
compiler is used. This doesn't work when GCC is used. 
real INVALID_REAL  Constant 
Actually, INVALID_REAL is the largest possible real value
(i.e., float or double ) on a given machine.
So, from the point of view of the compiler, it's not invalid at all.
However, 3DLDF uses it to indicate failure of some kind. For example,
the return value of a function returning real can be compared
with INVALID_REAL to check whether the function succeeded or
failed.
An alternative approach would be to use the exception handling facilities of C++ . I do use these, but only in a couple of places, so far. 
real_pair INVALID_REAL_PAIR  Constant 
first and second are both INVALID_REAL .

real INVALID_REAL_SHORT  Constant 
first is INVALID_REAL and second is 0.

real MAX_REAL  Variable 
The largest real value permitted in the the elements of
Transforms and the coordinates of
Points . It is the second largest real value (i.e.,
float or double ) on a given machine (INVALID_REAL
is the largest).

real MAX_REAL_SQRT  Variable 
The square root of MAX_REAL .
Metafont implements an operation called Pythagorean addition,
notated as " 