Floating point utility routines
Files | |
file | qint.h |
Quick floating point to integer conversions. | |
Functions | |
long | QInt (double inval) |
Truncate the fractional part of a floating-point value and convert to integer. | |
long | QRound (double inval) |
Round a floating-point value and convert to integer. | |
long | QInt8 (float inval) |
Convert a floating-point number to 24.8 fixed-point value. | |
long | QInt16 (float inval) |
Convert a floating-point number to 16.16 fixed-point value. | |
long | QInt24 (float inval) |
Convert a floating-point number to 8.24 fixed-point value. | |
float | qsqrt (float x) |
This routine computes sqrt(x) very quickly on Intel and PowerPC platforms. | |
float | qisqrt (float x) |
This routine is basically equivalent to qsqrt() except that it returns 1/sqrt(x) rather than the proper square root. |
Function Documentation
|
Truncate the fractional part of a floating-point value and convert to integer.
|
|
Convert a floating-point number to 16.16 fixed-point value.
|
|
Convert a floating-point number to 8.24 fixed-point value.
|
|
Convert a floating-point number to 24.8 fixed-point value.
|
|
This routine is basically equivalent to qsqrt() 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 qsqrt() and also you avoid a division. Definition at line 212 of file qsqrt.h. Referenced by csQuaternion::Normalize(). |
|
Round a floating-point value and convert to integer.
Definition at line 161 of file qint.h. Referenced by float2long(), and float2short(). |
|
This routine computes sqrt(x) very quickly on Intel and PowerPC platforms.
|
Generated for Crystal Space by doxygen 1.2.18