Loading...
Searching...
No Matches
Math

Functions for math. More...

Files

file  math.h
 Architecture-specific math function calls.
 

Macros

#define ARCH_MIN_FLOAT_EPS_SQR   0.000244141F
 This is the smallest value e such that 1+e^2 == 1, using floats.
 

Functions

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.
 
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.
 
double ArchBitPatternToDouble (uint64_t v)
 Returns The double precision floating point value corresponding to the given IEEE-754 bit pattern.
 
void ArchSinCosf (float v, float *s, float *c)
 Computes the sine and cosine of the specified value as a float.
 
void ArchSinCos (double v, double *s, double *c)
 Computes the sine and cosine of the specified value as a double.
 
int ArchCountTrailingZeros (uint64_t x)
 Return the number of consecutive 0-bits in x starting from the least significant bit position.
 

Detailed Description

Functions for math.

Macro Definition Documentation

◆ ARCH_MIN_FLOAT_EPS_SQR

#define ARCH_MIN_FLOAT_EPS_SQR   0.000244141F

This is the smallest value e such that 1+e^2 == 1, using floats.

True for all IEEE754 chipsets.

Definition at line 53 of file math.h.

Function Documentation

◆ ArchBitPatternToDouble()

double ArchBitPatternToDouble ( uint64_t  v)
inline

Returns The double precision floating point value corresponding to the given IEEE-754 bit pattern.

Definition at line 95 of file math.h.

◆ ArchBitPatternToFloat()

float ArchBitPatternToFloat ( uint32_t  v)
inline

Returns The single precision floating point value corresponding to the given IEEE-754 bit pattern.

Definition at line 73 of file math.h.

◆ ArchCountTrailingZeros()

int ArchCountTrailingZeros ( uint64_t  x)
inline

Return the number of consecutive 0-bits in x starting from the least significant bit position.

If x is 0, the result is undefined.

Definition at line 135 of file math.h.

◆ ArchDoubleToBitPattern()

uint64_t ArchDoubleToBitPattern ( double  v)
inline

Returns The IEEE-754 bit pattern of the specified double precision value as a 64-bit unsigned integer.

Definition at line 84 of file math.h.

◆ ArchFloatToBitPattern()

uint32_t ArchFloatToBitPattern ( float  v)
inline

Returns The IEEE-754 bit pattern of the specified single precision value as a 32-bit unsigned integer.

Definition at line 62 of file math.h.

◆ ArchSign()

long ArchSign ( long  val)
inline

Three-valued sign. Return 1 if val > 0, 0 if val == 0, or -1 if val < 0.

Definition at line 56 of file math.h.

◆ ArchSinCos()

void ArchSinCos ( double  v,
double *  s,
double *  c 
)
inline

Computes the sine and cosine of the specified value as a double.

Definition at line 114 of file math.h.

◆ ArchSinCosf()

void ArchSinCosf ( float  v,
float *  s,
float *  c 
)
inline

Computes the sine and cosine of the specified value as a float.

Definition at line 111 of file math.h.