|
fixed_point128 1.0.1.0
128 bit integer, fixed point and floating point arithmetic for C++20
|
Reduces what a math function's internal operations raise to what its result justifies. More...
#include <float128.h>
Public Member Functions | |
| flag_filter () noexcept | |
| ~flag_filter () | |
| flag_filter (const flag_filter &)=delete | |
| flag_filter & | operator= (const flag_filter &)=delete |
| template<typename T> | |
| T | inexact (const T &result) noexcept |
| The same as operator(), for a result known to be inexact without an operation having said so: an overflow or underflow decided from the argument's range alone. | |
| template<typename T> | |
| T | operator() (const T &result) noexcept |
| Records the flags a result justifies and passes the result through. | |
Reduces what a math function's internal operations raise to what its result justifies.
A function such as sin() is built from dozens of additions and multiplications, and those raise exceptions of their own: a series term underflows, an intermediate overflows on a path whose result does not. IEEE 754-2008 9.2 asks the function to signal as one operation would - inexact when the result is, overflow when the result overflowed, underflow when it is tiny and inexact. Constructed after a function has dealt with its special cases, which raise invalid and division by zero themselves, it sets the caller's flags aside; operator() then keeps inexact if any step raised it and derives the rest from the result. Compiles to nothing without FP128_IEEE_ENV.
Definition at line 332 of file float128.h.
|
inlinenoexcept |
Definition at line 335 of file float128.h.
|
inline |
Definition at line 342 of file float128.h.
|
delete |
|
delete |
|
inlinenodiscardnoexcept |
The same as operator(), for a result known to be inexact without an operation having said so: an overflow or underflow decided from the argument's range alone.
| T | float128 |
| result | The function's result |
Definition at line 358 of file float128.h.
|
inlinenodiscardnoexcept |
Records the flags a result justifies and passes the result through.
| T | float128, which is incomplete where this is declared |
| result | The function's result, from finite operands |
Definition at line 370 of file float128.h.