Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IceFPU.h File Reference

Go to the source code of this file.

Macros

#define SIGN_BITMASK   0x80000000
 
#define IR(x)   ((udword&)(x))
 Integer representation of a floating-point value. More...
 
#define SIR(x)   ((sdword&)(x))
 Signed integer representation of a floating-point value. More...
 
#define AIR(x)   (IR(x)&0x7fffffff)
 Absolute integer representation of a floating-point value. More...
 
#define FR(x)   ((float&)(x))
 Floating-point representation of an integer value. More...
 
#define CHECK_VALID_FLOAT(x)   OPASSERT(IsValidFloat(x));
 

Functions

inline_ bool IsNAN (float value)
 Is the float valid ? More...
 
inline_ bool IsIndeterminate (float value)
 
inline_ bool IsPlusInf (float value)
 
inline_ bool IsMinusInf (float value)
 
inline_ bool IsValidFloat (float value)
 

Detailed Description

Contains FPU related code.

Author
Pierre Terdiman
Date
April, 4, 2000

Definition in file IceFPU.h.

Macro Definition Documentation

#define AIR (   x)    (IR(x)&0x7fffffff)

Absolute integer representation of a floating-point value.

Definition at line 24 of file IceFPU.h.

Referenced by Point::ClosestAxis().

#define CHECK_VALID_FLOAT (   x)    OPASSERT(IsValidFloat(x));

Definition at line 44 of file IceFPU.h.

#define FR (   x)    ((float&)(x))

Floating-point representation of an integer value.

Definition at line 27 of file IceFPU.h.

Referenced by Point::Tweak(), and Point::TweakSmaller().

#define SIGN_BITMASK   0x80000000

Definition at line 15 of file IceFPU.h.

Referenced by Point::VectorCode().

#define SIR (   x)    ((sdword&)(x))

Signed integer representation of a floating-point value.

Definition at line 21 of file IceFPU.h.

Function Documentation

inline_ bool IsIndeterminate ( float  value)

Definition at line 31 of file IceFPU.h.

References IR.

Referenced by IsValidFloat().

31 { return IR(value) == 0xffc00000; }
inline_ bool IsMinusInf ( float  value)

Definition at line 33 of file IceFPU.h.

References IR.

Referenced by IsValidFloat().

33 { return IR(value) == 0xff800000; }
inline_ bool IsNAN ( float  value)

Is the float valid ?

Definition at line 30 of file IceFPU.h.

References IR.

Referenced by IsValidFloat().

30 { return (IR(value)&0x7f800000) == 0x7f800000; }
inline_ bool IsPlusInf ( float  value)

Definition at line 32 of file IceFPU.h.

References IR.

Referenced by IsValidFloat().

32 { return IR(value) == 0x7f800000; }
inline_ bool IsValidFloat ( float  value)

Definition at line 35 of file IceFPU.h.

References IsIndeterminate(), IsMinusInf(), IsNAN(), and IsPlusInf().

Referenced by Matrix3x3::IsValid(), Matrix4x4::IsValid(), and Point::IsValid().

36  {
37  if(IsNAN(value)) return false;
38  if(IsIndeterminate(value)) return false;
39  if(IsPlusInf(value)) return false;
40  if(IsMinusInf(value)) return false;
41  return true;
42  }