|
| constexpr auto | abs (auto const &arg) |
| constexpr auto | acos (auto const &arg) |
| constexpr auto | acosh (auto const &arg) |
| constexpr auto | arg (auto const &arg) |
| constexpr auto | asin (auto const &arg) |
| constexpr auto | asinh (auto const &arg) |
| constexpr auto | atan (auto const &arg) |
| constexpr auto | atan2 (auto const &y, auto const &x) |
| constexpr auto | atanh (auto const &arg) |
| constexpr auto | cbrt (auto const &arg) |
| constexpr auto | ceil (auto const &arg) |
| constexpr auto | conj (auto const &arg) |
| | Computes the complex conjugate of arg.
|
| constexpr auto | copysign (auto const &mag, auto const &sgn) |
| | Creates a value with the magnitude of mag and the sign of sgn.
|
| constexpr auto | cos (auto const &arg) |
| constexpr auto | cosh (auto const &arg) |
| constexpr auto | erf (auto const &arg) |
| constexpr auto | exp (auto const &arg) |
| template<typename T> |
| ALPAKA_FN_INLINE constexpr auto | floatEqualExactNoWarning (T a, T b) -> bool |
| | Compare two floating point numbers for exact equivalence.
|
| constexpr auto | floor (auto const &arg) |
| constexpr auto | fma (auto const &x, auto const &y, auto const &z) |
| constexpr auto | fmod (auto const &x, auto const &y) |
| constexpr auto | isfinite (auto const &arg) |
| constexpr auto | isinf (auto const &arg) |
| constexpr auto | isnan (auto const &arg) |
| constexpr auto | llround (auto const &arg) |
| | Computes the nearest integer value to arg (in integer format), rounding halfway cases away from zero, regardless of the current rounding mode.
|
| constexpr auto | log (auto const &arg) |
| | Computes the natural (base e) logarithm of arg.
|
| constexpr auto | log10 (auto const &arg) |
| constexpr auto | log2 (auto const &arg) |
| | Computes the base 2 logarithm of arg.
|
| constexpr auto | lround (auto const &arg) |
| | Computes the nearest integer value to arg (in integer format), rounding halfway cases away from zero, regardless of the current rounding mode.
|
| constexpr auto | max (auto const &a, auto const &b) |
| constexpr auto | min (auto const &a, auto const &b) |
| constexpr auto | pow (auto const &base, auto const &exp) |
| constexpr auto | remainder (auto const &x, auto const &y) |
| constexpr auto | round (auto const &arg) |
| | Computes the nearest integer value to arg (in floating-point format), rounding halfway cases away from zero, regardless of the current rounding mode.
|
| constexpr auto | rsqrt (auto const &arg) |
| constexpr auto | sin (auto const &arg) |
| constexpr auto | sincos (auto const &arg, auto &result_sin, auto &result_cos) |
| constexpr auto | sinh (auto const &arg) |
| constexpr auto | sqrt (auto const &arg) |
| constexpr auto | tan (auto const &arg) |
| constexpr auto | tanh (auto const &arg) |
| constexpr auto | trunc (auto const &arg) |
template<typename T>
| ALPAKA_FN_INLINE constexpr auto alpaka::math::floatEqualExactNoWarning |
( |
T | a, |
|
|
T | b ) -> bool |
|
constexpr |
Compare two floating point numbers for exact equivalence.
Use only when necessary, and be aware of the implications. Most codes should not use this function and instead implement a correct epsilon-based comparison. If you are unfamiliar with the topic, check out https://www.geeksforgeeks.org/problem-in-comparing-floating-point-numbers-and-how-to-compare-them-correctly/ or Goldberg 1991: "What every computer scientist should know about floating-point arithmetic", https://dl.acm.org/doi/10.1145/103162.103163
This function calls the == operator for floating point types, but disables the warning issued by the compiler when compiling with the float equality warning checks enabled. This warning is valid an valuable in most codes and should be generally enabled, but there are specific instances where a piece of code might need to do an exact comparison (e.g. CudaVectorArrayWrapperTest.cpp). The verbose name for the function is intentional as it should raise a red flag if used while not absolutely needed. Users are advised to add a justification whenever they use this function.
- Template Parameters
-
| T | both operands have to be the same type and conform to std::is_floating_point |
- Parameters
-
| a | first operand |
| b | second operand |
- Returns
- a == b
Definition at line 35 of file floatEqualExact.hpp.