10 #ifndef CPROVER_UTIL_IEEE_FLOAT_H
11 #define CPROVER_UTIL_IEEE_FLOAT_H
111 return !(*
this==other);
145 spec(std::move(__spec)),
278 void print(std::ostream &out)
const;
A constant literal expression.
Fixed-width bit-vector with IEEE floating-point interpretation.
mp_integer max_fraction() const
ieee_float_spect(std::size_t _f, std::size_t _e)
static ieee_float_spect half_precision()
ieee_float_spect(const floatbv_typet &type)
bool operator!=(const ieee_float_spect &other) const
static ieee_float_spect x86_80()
static ieee_float_spect single_precision()
static ieee_float_spect quadruple_precision()
bool operator==(const ieee_float_spect &other) const
class floatbv_typet to_type() const
mp_integer max_exponent() const
static ieee_float_spect x86_96()
void from_type(const floatbv_typet &type)
static ieee_float_spect double_precision()
std::size_t width() const
ieee_floatt(const constant_exprt &expr)
ieee_floatt & operator*=(const ieee_floatt &other)
void extract_base10(mp_integer &_exponent, mp_integer &_fraction) const
void make_minus_infinity()
void extract_base2(mp_integer &_exponent, mp_integer &_fraction) const
float to_float() const
Note that calling from_float -> to_float can return different bit patterns for NaN.
void unpack(const mp_integer &i)
mp_integer to_integer() const
std::string to_ansi_c_string() const
void make_plus_infinity()
bool operator!=(const ieee_floatt &other) const
bool ieee_equal(const ieee_floatt &other) const
ieee_floatt & operator+=(const ieee_floatt &other)
constant_exprt to_expr() const
void divide_and_round(mp_integer ÷nd, const mp_integer &divisor)
void set_sign(bool _sign)
void from_float(const float f)
static ieee_floatt plus_infinity(const ieee_float_spect &_spec)
ieee_floatt(const ieee_float_spect &_spec)
void from_expr(const constant_exprt &expr)
bool operator==(const ieee_floatt &other) const
static constant_exprt rounding_mode_expr(rounding_modet)
bool operator<=(const ieee_floatt &other) const
std::string to_string_scientific(std::size_t precision) const
format as [-]d.ddde+-d Note that printf always produces at least two digits for the exponent.
static ieee_floatt NaN(const ieee_float_spect &_spec)
std::string to_string_decimal(std::size_t precision) const
const mp_integer & get_exponent() const
ieee_floatt & operator-=(const ieee_floatt &other)
bool operator>(const ieee_floatt &other) const
static ieee_floatt minus_infinity(const ieee_float_spect &_spec)
static ieee_floatt zero(const floatbv_typet &type)
void next_representable(bool greater)
Sets *this to the next representable number closer to plus infinity (greater = true) or minus infinit...
bool ieee_not_equal(const ieee_floatt &other) const
void increment(bool distinguish_zero=false)
double to_double() const
Note that calling from_double -> to_double can return different bit patterns for NaN.
ieee_floatt & operator/=(const ieee_floatt &other)
bool operator>=(const ieee_floatt &other) const
std::string format(const format_spect &format_spec) const
void from_integer(const mp_integer &i)
rounding_modet rounding_mode
static mp_integer base10_digits(const mp_integer &src)
static ieee_floatt fltmin(const ieee_float_spect &_spec)
void decrement(bool distinguish_zero=false)
void build(const mp_integer &exp, const mp_integer &frac)
ieee_floatt(ieee_float_spect __spec, rounding_modet __rounding_mode)
void from_base10(const mp_integer &exp, const mp_integer &frac)
compute f * (10^e)
void from_double(const double d)
bool operator<(const ieee_floatt &other) const
void change_spec(const ieee_float_spect &dest_spec)
void print(std::ostream &out) const
ieee_floatt(const floatbv_typet &type)
const mp_integer & get_fraction() const
static ieee_floatt fltmax(const ieee_float_spect &_spec)
std::ostream & operator<<(std::ostream &out, const ieee_floatt &f)