CBMC
|
An IEEE 754 value plus a rounding mode, enabling operations with rounding on values. More...
#include <ieee_float.h>
Public Types | |
enum | rounding_modet { ROUND_TO_EVEN = 0 , ROUND_TO_MINUS_INF = 1 , ROUND_TO_PLUS_INF = 2 , ROUND_TO_ZERO = 3 , ROUND_TO_AWAY = 4 , UNKNOWN , NONDETERMINISTIC } |
Static Public Member Functions | |
static constant_exprt | rounding_mode_expr (rounding_modet) |
![]() | |
static ieee_float_valuet | zero (const floatbv_typet &type) |
static ieee_float_valuet | zero (const ieee_float_spect &spec) |
static ieee_float_valuet | one (const floatbv_typet &) |
static ieee_float_valuet | one (const ieee_float_spect &) |
static ieee_float_valuet | NaN (const ieee_float_spect &_spec) |
static ieee_float_valuet | plus_infinity (const ieee_float_spect &_spec) |
static ieee_float_valuet | minus_infinity (const ieee_float_spect &_spec) |
static ieee_float_valuet | fltmax (const ieee_float_spect &_spec) |
static ieee_float_valuet | fltmin (const ieee_float_spect &_spec) |
Protected Member Functions | |
void | divide_and_round (mp_integer ÷nd, const mp_integer &divisor) |
void | align () |
![]() | |
void | next_representable (bool greater) |
Sets *this to the next representable number closer to plus infinity (greater = true) or minus infinity (greater = false). | |
Protected Attributes | |
rounding_modet | _rounding_mode |
![]() | |
bool | sign_flag |
mp_integer | exponent |
mp_integer | fraction |
bool | NaN_flag |
bool | infinity_flag |
Additional Inherited Members | |
![]() | |
ieee_float_spect | spec |
![]() | |
static mp_integer | base10_digits (const mp_integer &src) |
An IEEE 754 value plus a rounding mode, enabling operations with rounding on values.
Definition at line 337 of file ieee_float.h.
Enumerator | |
---|---|
ROUND_TO_EVEN | |
ROUND_TO_MINUS_INF | |
ROUND_TO_PLUS_INF | |
ROUND_TO_ZERO | |
ROUND_TO_AWAY | |
UNKNOWN | |
NONDETERMINISTIC |
Definition at line 346 of file ieee_float.h.
|
inline |
Definition at line 365 of file ieee_float.h.
|
inline |
Definition at line 370 of file ieee_float.h.
|
inline |
Definition at line 379 of file ieee_float.h.
|
inline |
Definition at line 384 of file ieee_float.h.
|
inline |
Definition at line 389 of file ieee_float.h.
|
protected |
Definition at line 821 of file ieee_float.cpp.
void ieee_floatt::build | ( | const mp_integer & | exp, |
const mp_integer & | frac | ||
) |
Definition at line 566 of file ieee_float.cpp.
void ieee_floatt::change_spec | ( | const ieee_float_spect & | dest_spec | ) |
Definition at line 1231 of file ieee_float.cpp.
|
protected |
Definition at line 954 of file ieee_float.cpp.
void ieee_floatt::from_base10 | ( | const mp_integer & | exp, |
const mp_integer & | frac | ||
) |
compute f * (10^e)
Definition at line 784 of file ieee_float.cpp.
void ieee_floatt::from_integer | ( | const mp_integer & | i | ) |
Definition at line 813 of file ieee_float.cpp.
ieee_floatt & ieee_floatt::operator*= | ( | const ieee_floatt & | other | ) |
Definition at line 1097 of file ieee_float.cpp.
ieee_floatt & ieee_floatt::operator+= | ( | const ieee_floatt & | other | ) |
Definition at line 1133 of file ieee_float.cpp.
ieee_floatt & ieee_floatt::operator-= | ( | const ieee_floatt & | other | ) |
Definition at line 1224 of file ieee_float.cpp.
ieee_floatt & ieee_floatt::operator/= | ( | const ieee_floatt & | other | ) |
Definition at line 1023 of file ieee_float.cpp.
ieee_floatt ieee_floatt::round_to_integral | ( | ) | const |
Definition at line 1371 of file ieee_float.cpp.
|
inline |
Definition at line 357 of file ieee_float.h.
|
static |
Definition at line 561 of file ieee_float.cpp.
double ieee_floatt::to_double | ( | ) | const |
float ieee_floatt::to_float | ( | ) | const |
mp_integer ieee_floatt::to_integer | ( | ) | const |
Definition at line 1256 of file ieee_float.cpp.
|
protected |
Definition at line 419 of file ieee_float.h.