30 bool is_float, is_long, is_imaginary;
31 bool is_decimal, is_float80, is_float128;
61 result.
type().
set(ID_C_c_type, ID_long_double);
66 result.
type().
set(ID_C_c_type, ID_gcc_float128);
86 unsigned fraction_bits;
92 fraction_bits=width/2;
94 fraction_bits=width-std::stoi(
id2string(integer_bits));
102 value/=
power(base, -exponent);
105 value*=
power(base, exponent);
107 if(value>=
power(2, width-1))
110 value=
power(2, width-1)-1;
112 else if(value<=-
power(2, width-1)-1)
115 value=-
power(2, width-1);
129 a.
build(significand, exponent);
142 exprt complex_expr(ID_complex, complex_type);
145 complex_expr.
op1()=result;
struct configt::ansi_ct ansi_c
void parse_float(const std::string &src, mp_integer &significand, mp_integer &exponent, unsigned &exponent_base, bool &is_float, bool &is_long, bool &is_imaginary, bool &is_decimal, bool &is_float80, bool &is_float128)
const std::string & id2string(const irep_idt &d)
void build(const mp_integer &exp, const mp_integer &frac)
signed int get_int(const irep_namet &name) const
bool single_precision_constant
bitvector_typet double_type()
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a generic typet to a floatbv_typet.
class floatbv_typet to_type() const
bitvector_typet float_type()
static ieee_float_spect quadruple_precision()
API to expression classes.
const irep_idt & get(const irep_namet &name) const
void from_base10(const mp_integer &exp, const mp_integer &frac)
compute f * (10^e)
ANSI-C Conversion / Type Checking.
bitvector_typet long_double_type()
Complex numbers made of pair of given subtype.
Base class for all expressions.
exprt convert_float_literal(const std::string &src)
const std::string integer2binary(const mp_integer &n, std::size_t width)
std::size_t width() const
const typet & subtype() const
void set(const irep_namet &name, const irep_idt &value)