23.11
|
Go to the documentation of this file.
24 #ifndef ACL_SRC_CORE_UTILS_HELPERS_FLOAT_OPS_H
25 #define ACL_SRC_CORE_UTILS_HELPERS_FLOAT_OPS_H
60 return (
i32 >> 23) & 0xFF;
68 return i32 & 0x007FFFFF;
89 const int ulps = std::abs(ra.
i32 - rb.
i32);
90 return ulps <= max_allowed_ulps;
102 return std::abs(1.0f - a) <=
epsilon;
114 return std::abs(0.0f - a) <=
epsilon;
119 #endif // ACL_SRC_CORE_UTILS_HELPERS_FLOAT_OPS_H
int32_t sign() const
Extract sign of floating point number.
int32_t exponent() const
Extract exponent of floating point number.
bool is_zero(float a, float epsilon=0.00001f)
Checks if the input floating point number is 0.0f checking if the difference is within a range define...
bool is_equal_ulps(float a, float b, int max_allowed_ulps=0)
Checks if two floating point numbers are equal given an allowed number of ULPs.
int32_t mantissa() const
Extract mantissa of floating point number.
Copyright (c) 2017-2023 Arm Limited.
RawFloat(float val)
Constructor.
bool is_one(float a, float epsilon=0.00001f)
Checks if the input floating point number is 1.0f checking if the difference is within a range define...