Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
finite.hpp File Reference

Finiteness of a float, read from its bits, and a fallback for a value that is not finite. More...

Detailed Description

Finiteness of a float, read from its bits, and a fallback for a value that is not finite.

The exponent's bits answer with an integer compare, with no FPU compare.

Definition in file finite.hpp.

#include <cstdint>
#include <sbl/math/magnitude.hpp>

Go to the source code of this file.

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::math
 Domain-neutral math: constants, clamp, interpolation.
 

Functions

bool sbl::math::is_finite (float x)
 std::isfinite, read from the exponent's bits.
 
float sbl::math::finite_or (float x, float fallback)
 x, or fallback when x is an infinity or a NaN.
 

Variables

constexpr uint32_t sbl::math::FLOAT_EXPONENT_BITS = 0x7F800000u
 A single's exponent field: all ones in infinities and NaNs.