next up previous contents index
Next: 2.7 File input/output Up: 2. The C Interface Previous: 2.5 Error handling

  
2.6 Predefined Constants

Following is a list of predefined UDI_object" constant scalars, provided as a convenience to the user. They may be used as arguments to functions requiring a scalar input. Here's an example code excerpt which creates a vector, fills it with values representing a triangular DSP window, and then divides each element by $2\pi$:
        UDI_object a, b;

        create_vector(a, 512, ELEM_REAL, VAL_FLOAT);
        trian(a);

        create_vector(b, 512, ELEM_REAL, VAL_FLOAT);

        vsdiv(a, Krf_2PI, b)
Note that if you didn't use the predefined constant, it would be necessary to create a SPMquotUDI_object" scalar explicitly with SPMquotcreate_scalar", and then use put_scalar" to assign it a value. Constants are defined for types: REAL_SHORT", REAL_LONG", SPMquotREAL_FLOAT", and SPMquotREAL_DOUBLE". Note that for the floating point constants, the high precision of the value in the table is specified for SPMquotREAL_DOUBLE", so all the digits are not usually significant for SPMquotREAL_FLOAT", depending on the machine architecture.

REAL_SHORT" constants REAL_LONG" constants value
Krs_0 Krl_0 0

Krs_1

Krl_1 1
Krs_m_1 Krl_m_1 -1

Krs_2

Krl_2 2
Krs_m_2 Krl_m_ -2

Krs_4

Krl_4 4
Krs_m_4 Krl_m_ -4

Krs_8

Krl_8 8
Krs_m_8 Krl_m_ -8

Krs_16

Krl_16 16
Krs_m_16 Krl_m_ -16

Krs_32

Krl_32 32
Krs_m_32 Krl_m_ -32

Krs_64

Krl_64 64
Krs_m_64 Krl_m_ -64

Krs_128

Krl_128 128
Krs_m_128 Krl_m_ -128

Krs_256

Krl_256 256
Krs_m_256 Krl_m_ -256

Krs_512

Krl_512 512
Krs_m_512 Krl_m_ -512

Krs_1024

Krl_1024 1024
Krs_m_1024 Krl_m_ -1024

Krs_2048

Krl_2048 2048
Krs_m_2048 Krl_m_ -2048

Krs_4096

Krl_4096 4096
Krs_m_4096 Krl_m_ -4096

Krs_8192

Krl_8192 8192
Krs_m_8192 Krl_m_ -8192

Krs_16384

Krl_16384 16384
Krs_m_16384 Krl_m_ -16384

Krs_MAX

Krl_MAX largest short or long
Krs_MIN Krl_MIN smallest short or long

SPMquotREAL_FLOAT" constants SPMquotREAL_DOUBLE" constants value

Krf_0

Krd_0 0.0

Krf_1

Krd_1 1.0
Krf_m_1 Krd_m_1 -1.0

Krf_2

Krd_2 2.0
Krf_m_2 Krd_m_2 -2.0
Krf_o_2 Krd_o_2 0.5
Krf_om_2 Krd_om_2 -0.5

Krf_4

Krd_4 4.0
Krf_m_4 Krd_m_4 -4.0
Krf_o_4 Krd_o_4 0.25
Krf_om_4 Krd_om_4 -0.25

Krf_PI

Krd_PI 3.14159265358979323846
Krf_m_PI Krd_m_PI -3.14159265358979323846
Krf_o_PI Krd_o_PI 0.31830988618379067154
Krf_om_PI Krd_om_PI -0.31830988618379067154

Krf_2PI

Krd_2PI 6.28318530717959
Krf_m_2PI Krd_m_2PI -6.28318530717959
Krf_o_2PI Krd_o_2PI 0.15915494309190
Krf_om_2PI Krd_om_2PI -0.15915494309190

Krf_4PI

Krd_4PI 12.56637061435917
Krf_m_4PI Krd_m_4PI -12.56637061435917
Krf_o_4PI Krd_o_4PI 0.07957747154595
Krf_om_4PI Krd_om_4PI -0.07957747154595

Krf_sq_PI

Krd_sq_PI 9.86960440108936
Krf_m_sq_PI Krd_m_sq_PI -9.86960440108936
Krf_o_sq_PI Krd_o_sq_PI 0.10132118364234
Krf_om_sq_PI Krd_om_sq_PI -0.10132118364234

Krf_sq_2PI

Krd_sq_2PI 39.47841760435743
Krf_m_sq_2PI Krd_m_sq_2PI -39.47841760435743
Krf_o_sq_2PI Krd_o_sq_2PI 0.02533029591058
Krf_om_sq_2PI Krd_om_sq_2PI -0.02533029591058

Krf_sqrt_2

Krd_sqrt_2 1.41421356237310
Krf_sqrt_3 Krd_sqrt_3 1.73205080756888
Krf_sqrt_5 Krd_sqrt_5 2.23606797749979
Krf_sqrt_PI Krd_sqrt_PI 1.77245385090552

Krf_ln_2

Krd_ln_2 0.69314718055995
Krf_ln_10 Krd_ln_10 2.30258509299405

Krf_log_2

Krd_log_2 0.30102999566398
Krf_log_E Krd_log_E 0.43429448190325

Krf_log2_E

Krd_log2_E 1.44269504088896
Krf_log2_10 Krd_log2_10 3.32192809488736

Krf_E

Krd_E 2.71828182845905
Krf_m_E Krd_m_E -2.71828182845905
Krf_o_E Krd_o_E 0.36787944117144
Krf_om_E Krd_om_E -0.36787944117144

Krf_MAX;

Krd_MAX 1.701e+38


next up previous contents index
Next: 2.7 File input/output Up: 2. The C Interface Previous: 2.5 Error handling
Diemo Schwarz
1999-03-04