30 #ifndef _3D_FASTMATH_H 31 #define _3D_FASTMATH_H 41 #define L1_CACHE_LINE_SIZE 64 44 #define INTFLOORF(s) (lrintf( (s) - (0.5f - FLT_EPSILON) )) 46 #define INTFLOORF(s) ((int)( floor(s) )) 100 memcpy( &ui, &f,
sizeof(
float ) );
110 memcpy( &f, &ui,
sizeof (uint32_t ) );
120 memcpy( &ui, &f,
sizeof(
double ) );
130 memcpy( &f, &ui,
sizeof( uint64_t ) );
139 if( std::isinf( v ) && (v > 0.) )
160 if( std::isinf( v ) && (v < 0.) )
176 #endif // 3D_FASTMATH_H float BitsToFloat(uint32_t ui)
float NextFloatDown(float v)
uint32_t FloatToBits(float f)
This part contains some functions from the PBRT 3 source code.
void Fast_srand(unsigned int seed)
float NextFloatUp(float v)