Cube-it 16.3 User Documentation
A few commonly used variables are predefined in APREPRO. These are listed below. The default output format is specified as a C language format string, see your C language documentation for more information. The default format and comment variables are defined with a leading underscore in their name so they can be redefined without generating an error message.
Table 1. Predefined Variables
Name |
Value |
Description |
|||
PI |
3.14159265358979323846 |
pi |
|||
PI_2 |
1.57079632679489661923 |
pi/2 |
|||
SQRT2 |
1.41421356237309504880 |
|
|||
DEG |
57.2957795130823208768 |
180 /pi degrees per radian |
|||
RAD |
0.01745329251994329576 |
pi/180 radians per degree |
|||
E |
2.71828182845904523536 |
base of natural logarithm |
|||
GAMMA |
0.57721566490153286060 |
euler-mascheroni constant1 |
|||
PHI |
1.61803398874989484820 |
golden ratio ( |
|||
CUBIT_VERSION |
Varies, string value |
current version of Cubit |
|||
VERSION |
Varies, string value |
current version of APREPRO |
|||
_ FORMAT |
"%.10g" |
default output format |
|||
_C_ |
"#" |
default comment character |
1 The euler-mascheroni constant is defined as the limit of 1 + 1/2 + ... + 1/s - log(s) as s approaches infinity.
Note that the output format is used to output both integers and floating point numbers. Therefore, it should use the %g format descriptor which will use either the decimal (%d), exponential (%e), or float (%f) format, whichever is shorter, with insignificant zeros suppressed. The table below illustrates the effect of different format specifications on the output of the variable PI and the value 1.0 . See the documentation of your C compiler for
Table 2. Effect of Various Output Format Specifications more information. For most cases, the default value is sufficient.
Format |
PI Output |
1.0 Output |
|||
%.10g |
3.141592654 |
1 |
|||
%.10e |
3.1415926536e+00 |
1.0000000000e+00 |
|||
%.10f |
3.1415926536 |
1.0000000000 |
|||
%.10d |
1413754136 |
0000000000 |