CrystalSpace

Public API Reference

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

Floating point utility routines


Files

file  csqint.h
 Quick floating point to integer conversions.

Functions

long csQint (double inval)
 Truncate the fractional part of a floating-point value and convert to integer.
long csQround (double inval)
 Round a floating-point value and convert to integer.
long csQint8 (float inval)
 Convert a floating-point number to 24.8 fixed-point value.
long csQint16 (float inval)
 Convert a floating-point number to 16.16 fixed-point value.
long csQint24 (float inval)
 Convert a floating-point number to 8.24 fixed-point value.
float csQsqrt (float x)
 This routine computes sqrt(x) very quickly on Intel and PowerPC platforms.
float csQisqrt (float x)
 This routine is basically equivalent to csQsqrt() except that it returns 1/sqrt(x) rather than the proper square root.

Function Documentation

static inline long csQint double  inval  )  [inline, static]
 

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

Definition at line 142 of file csqint.h.

Referenced by csG2DDrawLine< Tpixel, Tpixmixer >::DrawLine().

long csQint16 float  inval  )  [inline]
 

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

Definition at line 219 of file csqint.h.

Referenced by csG2DDrawLine< Tpixel, Tpixmixer >::DrawLine().

long csQint24 float  inval  )  [inline]
 

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

Definition at line 243 of file csqint.h.

long csQint8 float  inval  )  [inline]
 

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

Definition at line 195 of file csqint.h.

float csQisqrt float  x  )  [inline, static]
 

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 212 of file csqsqrt.h.

Referenced by csQuaternion::Normalize().

long csQround double  inval  )  [inline, static]
 

Round a floating-point value and convert to integer.

Definition at line 171 of file csqint.h.

float csQsqrt float  x  )  [inline, static]
 

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

Definition at line 211 of file csqsqrt.h.


Generated for Crystal Space by doxygen 1.3.9.1