24 #ifndef PXR_BASE_ARCH_MATH_H
25 #define PXR_BASE_ARCH_MATH_H
32 #include "pxr/base/arch/defines.h"
37 #define M_PI 3.14159265358979323846
40 PXR_NAMESPACE_OPEN_SCOPE
45 #if defined (ARCH_CPU_INTEL) || defined (ARCH_CPU_ARM) || defined (doxygen)
49 #define ARCH_MIN_FLOAT_EPS_SQR 0.000244141F
53 return (val > 0) - (val < 0);
101 #error Unknown system architecture.
104 #if defined(ARCH_OS_LINUX) || defined(doxygen)
107 inline void ArchSinCosf(
float v,
float *s,
float *c) { sincosf(v, s, c); }
110 inline void ArchSinCos(
double v,
double *s,
double *c) { sincos(v, s, c); }
112 #elif defined(ARCH_OS_DARWIN) || defined(ARCH_OS_WINDOWS)
114 inline void ArchSinCosf(
float v,
float *s,
float *c) {
118 inline void ArchSinCos(
double v,
double *s,
double *c) {
124 #error Unknown architecture.
129 PXR_NAMESPACE_CLOSE_SCOPE
131 #endif // PXR_BASE_ARCH_MATH_H
double ArchBitPatternToDouble(uint64_t v)
Returns The double precision floating point value corresponding to the given IEEE-754 bit pattern...
float ArchBitPatternToFloat(uint32_t v)
Returns The single precision floating point value corresponding to the given IEEE-754 bit pattern...
uint64_t ArchDoubleToBitPattern(double v)
Returns The IEEE-754 bit pattern of the specified double precision value as a 64-bit unsigned integer...
void ArchSinCosf(float v, float *s, float *c)
Computes the sine and cosine of the specified value as a float.
long ArchSign(long val)
Three-valued sign. Return 1 if val > 0, 0 if val == 0, or -1 if val < 0.
uint32_t ArchFloatToBitPattern(float v)
Returns The IEEE-754 bit pattern of the specified single precision value as a 32-bit unsigned integer...
void ArchSinCos(double v, double *s, double *c)
Computes the sine and cosine of the specified value as a double.