Floating point utility routines
Files | |
file | csqint.h |
Quick floating point to integer conversions. | |
Functions | |
static long | csQfixed16 (float n) |
Quickly convert a floating-point number to 16.16 fixed-point value. | |
static long | csQfixed24 (float n) |
Quickly convert a floating-point number to 8.24 fixed-point value. | |
static long | csQfixed8 (float n) |
Quickly convert a floating-point number to 24.8 fixed-point value. | |
static long | csQint (double n) |
Quickly truncate the fractional part of a floating-point value and convert it to a long integer using processor and/or number format quirks if available. | |
static float | csQisqrt (float x) |
This routine is basically equivalent to csQsqrt() except that it returns 1/sqrt(x) rather than the proper square root. | |
static long | csQround (double n) |
Quickly round a floating-point value and convert it to a long integer using processor and/or number format quirks if available. | |
static float | csQsqrt (float x) |
This routine computes sqrt(x) very quickly on Intel and PowerPC platforms. |
Function Documentation
|
Quickly convert a floating-point number to 16.16 fixed-point value.
Definition at line 52 of file csqint.h. Referenced by csQint16(), and csG2DDrawLine< Tpixel, Tpixmixer >::DrawLine(). |
|
Quickly convert a floating-point number to 8.24 fixed-point value.
Definition at line 57 of file csqint.h. Referenced by csQint24(). |
|
Quickly convert a floating-point number to 24.8 fixed-point value.
Definition at line 47 of file csqint.h. Referenced by csQint8(). |
|
Quickly truncate the fractional part of a floating-point value and convert it to a long integer using processor and/or number format quirks if available.
Definition at line 35 of file csqint.h. Referenced by csG2DDrawLine< Tpixel, Tpixmixer >::DrawLine(). |
|
This routine is basically equivalent to csQsqrt() except that it returns 1/sqrt(x) rather than the proper square root. It should be used anywhere you need the inverse root (in 3D graphics it is a common situation), because the routine is a little faster than csQsqrt() and also you avoid a division. Definition at line 98 of file csqsqrt.h. Referenced by csQuaternion::Normalize(). |
|
Quickly round a floating-point value and convert it to a long integer using processor and/or number format quirks if available.
|
|
This routine computes sqrt(x) very quickly on Intel and PowerPC platforms.
Definition at line 97 of file csqsqrt.h. Referenced by csSpotLightProc< AttenuationProc >::ProcessVertex(), csDirectionalLightProc< AttenuationProc >::ProcessVertex(), and csPointLightProc< AttenuationProc >::ProcessVertex(). |
Generated for Crystal Space by doxygen 1.4.4