Basic floating point functions#
Basic real functions
- Operator overloading, general real functions
- Operator overloading: scope and restrictions
- The cost of creating and destroying objects
- Raw addition of two floating point numbers
- Raw subtraction of two floating point numbers
- Raw multiplication of two floating point numbers
- Raw division of two floating point numbers
- Raw addition of a floating point number and a signed 32 bit integer
- Raw subtraction of a floating point number and a signed 32 bit integer
- Raw multiplication of a floating point number and a signed 32 bit integer
- Raw division of a floating point number and a signed 32 bit integer
- Fused multiplication and addition: \(\mathrm{fma}(x, y, z)\)
- Maximum of two floating point numbers: \(\mathrm{fmax}(x, y)\)
- Minimum of two floating point numbers: \(\mathrm{fmin}(x, y)\)
- Machine constants, general
- Properties of numbers
- Test for signbit
- Test for a finite number
- Test for infinity
- Test for positive infinity
- Test for negative infinity
- Test for NaN
- Test for zero
- Test for one
- Test if a number is an integer
- Test if a number is a simple number (not an infinity or NaN)
- Test if a number is a regular number (not zero, an infinity or NaN)
- Test if a number is a normal number (not subnormal, zero, an infinity or NaN)
- Test if 2 numbers are unordered
- Test if a number fits in a signed 32 bit integer
- Test if a number fits in a signed 64 bit integer
- Integer related functions
- Integral value nearest \(x\) (rounding to nearest): \(\mathrm{nearbyint}(x), \mathrm{rint}(x)\)
- 32 bit integer nearest \(x\) (rounding to nearest): \(\mathrm{lrint}(x)\)
- 64 bit integer nearest \(x\) (rounding to nearest): \(\mathrm{llrint}(x)\)
- Smallest integral value not less than \(x: \mathrm{ceil}(x)\)
- Largest integral value not greater than \(x: \mathrm{floor}(x)\)
- Nearest integral value not greater in magnitude than \(x: \mathrm{trunc}(x)\)
- Nearest integral value, rounding halfway cases away from zero: \(\mathrm{round}(x)\)
- Nearest 32 bit integer, rounding halfway cases away from zero: \(\mathrm{lround}(x)\)
- Nearest 64 bit integer, rounding halfway cases away from zero: \(\mathrm{llround}(x)\)
- Floating point functions for real numbers
- Efficient computation of \(|x| \cdot \mathrm{sign}(y): \mathrm{copysign}(x, y)\)
- Decomposition of \(x\) as \(x = m \cdot 2^e; 0.5<m<1: \mathrm{frexp}(x)\)
- Integral value \(e\), from the decomposition of \(x\) as \(x = m \cdot 2^e; 1<m<2: \mathrm{logb}(x)\)
- 32 bit integer \(e\), from the decomposition of \(x\) as \(x = m \cdot 2^e; 1<m<2: \mathrm{ilogb}(x)\)
- Efficient computation of \(x \cdot 2^e: \mathrm{ldexp}(x,e), \mathrm{scalbn}(x,e), \mathrm{scalbln}(x,e)\)
- Positive difference between \(x\) and \(y\): \(\mathrm{fdim}(x, y)\)
- Fraction and remainder related functions
- Functions related to mantissa width and exponent range
- Machine Epsilon
- Unit in the last place
- Largest representable number
- Lowest representable number
- Smallest representable positive number
- Next representable floating point number: \(\mathrm{nexttowards}(x, y)\)
- Next representable floating point number: \(\mathrm{nextabove}(x)\)
- Next representable floating point number: \(\mathrm{nextbelow}(x)\)
- Mathematical Constants