#include <stdlib.h>
#include "Platform.h"
Namespaces | |
namespace | Common |
Defines | |
#define | FLOAT_AS_INT(x) ( ( *(int*)&( x ) ) ) |
This macro interprets float as int for easier bitwies access. | |
#define | DOUBLE_AS_LONGLONG(x) ( ( *(long long*)&( x ) ) ) |
This macro interprets double as long long for easier bitwies access. | |
#define | FLOAT_SIGN 0x80000000UL |
Extracts sign from single precision floating point number. | |
#define | DOUBLE_SIGN 0x8000000000000000ULL |
Extracts sign from double precision floating point number. | |
Functions | |
bool GAL_API | Common::FloatsEqual (float x, float y, int ulpTolerance=10) |
This method compares two single precision floating point numbers for equality with defined level of tolerance. | |
bool GAL_API | Common::DoublesEqual (double x, double y, int ulpTolerance=10) |
This method compares two double precision floating point numbers for equality with defined level of tolerance. |
#define DOUBLE_AS_LONGLONG | ( | x | ) | ( ( *(long long*)&( x ) ) ) |
This macro interprets double
as long long
for easier bitwies access.
#define DOUBLE_SIGN 0x8000000000000000ULL |
Extracts sign from double precision floating point number.
#define FLOAT_AS_INT | ( | x | ) | ( ( *(int*)&( x ) ) ) |
This macro interprets float
as int
for easier bitwies access.
#define FLOAT_SIGN 0x80000000UL |
Extracts sign from single precision floating point number.