CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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

static inline long QInt double    inval [inline, static]
 

Truncate the fractional part of a floating-point value and convert to integer.

Definition at line 142 of file qint.h.

long QInt16 float    inval [inline]
 

Convert a floating-point number to 16.16 fixed-point value.

Definition at line 187 of file qint.h.

long QInt24 float    inval [inline]
 

Convert a floating-point number to 8.24 fixed-point value.

Definition at line 200 of file qint.h.

long QInt8 float    inval [inline]
 

Convert a floating-point number to 24.8 fixed-point value.

Definition at line 174 of file qint.h.

float qisqrt float    x [inline, static]
 

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().

long QRound double    inval [inline, static]
 

Round a floating-point value and convert to integer.

Definition at line 161 of file qint.h.

Referenced by float2long(), and float2short().

float qsqrt float    x [inline, static]
 

This routine computes sqrt(x) very quickly on Intel and PowerPC platforms.

Definition at line 211 of file qsqrt.h.


Generated for Crystal Space by doxygen 1.2.18