ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
ieee_floatt Class Reference

#include <ieee_float.h>

Public Types

enum  rounding_modet {
  ROUND_TO_EVEN = 0 , ROUND_TO_AWAY = 1 , ROUND_TO_PLUS_INF = 2 , ROUND_TO_MINUS_INF = 3 ,
  ROUND_TO_ZERO = 4 , UNKNOWN , NONDETERMINISTIC
}

Public Member Functions

 ieee_floatt ()
 ieee_floatt (const ieee_float_spect &s)
 ieee_floatt (const constant_exprt &expr)
void negate ()
void set_sign (bool _sign)
void make_zero ()
void make_NaN ()
void make_plus_infinity ()
void make_minus_infinity ()
void make_fltmax ()
void make_fltmin ()
void increment (bool distinguish_zero=false)
void decrement (bool distinguish_zero=false)
bool is_zero () const
bool is_negative () const
bool get_sign () const
bool is_NaN () const
bool is_infinity () const
bool is_finite () const
bool is_normal () const
const BigInt & get_exponent () const
const BigInt & get_fraction () const
void from_integer (const BigInt &i)
void from_base10 (const BigInt &exp, const BigInt &frac)
void build (const BigInt &exp, const BigInt &frac)
void unpack (const BigInt &i)
void from_double (const double d)
void from_float (const float f)
double to_double () const
float to_float () const
bool is_double () const
bool is_float () const
BigInt pack () const
void extract_base2 (BigInt &_fraction, BigInt &_exponent) const
void extract_base10 (BigInt &_fraction, BigInt &_exponent) const
BigInt to_integer () const
void change_spec (const ieee_float_spect &dest_spec)
void print (std::ostream &out) const
std::string to_ansi_c_string () const
std::string to_string_decimal (unsigned precision) const
std::string to_string_scientific (unsigned precision) const
std::string format (const format_spect &format_spec) const
constant_exprt to_expr () const
void from_expr (const constant_exprt &expr)
ieee_floatt & operator/= (const ieee_floatt &other)
ieee_floatt & operator*= (const ieee_floatt &other)
ieee_floatt & operator+= (const ieee_floatt &other)
ieee_floatt & operator-= (const ieee_floatt &other)
ieee_floatt & operator- ()

Static Public Member Functions

static ieee_floatt NaN (const ieee_float_spect &_spec)
static ieee_floatt plus_infinity (const ieee_float_spect &_spec)
static ieee_floatt minus_infinity (const ieee_float_spect &_spec)
static ieee_floatt fltmax (const ieee_float_spect &_spec)
static ieee_floatt fltmin (const ieee_float_spect &_spec)

Public Attributes

rounding_modet rounding_mode
ieee_float_spect spec

Protected Member Functions

void divide_and_round (BigInt &fraction, const BigInt &factor)
void align ()
void next_representable (bool greater)

Static Protected Member Functions

static BigInt base10_digits (const BigInt &src)

Protected Attributes

bool sign_flag
BigInt exponent
BigInt fraction
bool NaN_flag
bool infinity_flag

Friends

std::ostream & operator<< (std::ostream &out, const ieee_floatt &f)
ieee_floatt operator+ (const ieee_floatt &lhs, const ieee_floatt &rhs)
ieee_floatt operator- (const ieee_floatt &lhs, const ieee_floatt &rhs)
bool operator< (const ieee_floatt &a, const ieee_floatt &b)
bool operator<= (const ieee_floatt &a, const ieee_floatt &b)
bool operator> (const ieee_floatt &a, const ieee_floatt &b)
bool operator>= (const ieee_floatt &a, const ieee_floatt &b)
bool operator== (const ieee_floatt &a, const ieee_floatt &b)
bool operator!= (const ieee_floatt &a, const ieee_floatt &b)
bool operator== (const ieee_floatt &a, int i)
bool operator> (const ieee_floatt &a, int i)
bool operator< (const ieee_floatt &a, int i)
bool operator>= (const ieee_floatt &a, int i)
bool operator<= (const ieee_floatt &a, int i)

Member Enumeration Documentation

◆ rounding_modet

Enumerator
ROUND_TO_EVEN 
ROUND_TO_AWAY 
ROUND_TO_PLUS_INF 
ROUND_TO_MINUS_INF 
ROUND_TO_ZERO 
UNKNOWN 
NONDETERMINISTIC 

Constructor & Destructor Documentation

◆ ieee_floatt() [1/3]

ieee_floatt::ieee_floatt ( )
explicit

◆ ieee_floatt() [2/3]

ieee_floatt::ieee_floatt ( const ieee_float_spect & s)
explicit

◆ ieee_floatt() [3/3]

ieee_floatt::ieee_floatt ( const constant_exprt & expr)
explicit

Member Function Documentation

◆ align()

void ieee_floatt::align ( )
protected

◆ base10_digits()

BigInt ieee_floatt::base10_digits ( const BigInt & src)
staticprotected

◆ build()

void ieee_floatt::build ( const BigInt & exp,
const BigInt & frac )

◆ change_spec()

void ieee_floatt::change_spec ( const ieee_float_spect & dest_spec)

◆ decrement()

void ieee_floatt::decrement ( bool distinguish_zero = false)
inline

◆ divide_and_round()

void ieee_floatt::divide_and_round ( BigInt & fraction,
const BigInt & factor )
protected

◆ extract_base10()

void ieee_floatt::extract_base10 ( BigInt & _fraction,
BigInt & _exponent ) const

◆ extract_base2()

void ieee_floatt::extract_base2 ( BigInt & _fraction,
BigInt & _exponent ) const

◆ fltmax()

ieee_floatt ieee_floatt::fltmax ( const ieee_float_spect & _spec)
inlinestatic

◆ fltmin()

ieee_floatt ieee_floatt::fltmin ( const ieee_float_spect & _spec)
inlinestatic

◆ format()

std::string ieee_floatt::format ( const format_spect & format_spec) const

◆ from_base10()

void ieee_floatt::from_base10 ( const BigInt & exp,
const BigInt & frac )

◆ from_double()

void ieee_floatt::from_double ( const double d)

◆ from_expr()

void ieee_floatt::from_expr ( const constant_exprt & expr)

◆ from_float()

void ieee_floatt::from_float ( const float f)

◆ from_integer()

void ieee_floatt::from_integer ( const BigInt & i)

◆ get_exponent()

const BigInt & ieee_floatt::get_exponent ( ) const
inline

◆ get_fraction()

const BigInt & ieee_floatt::get_fraction ( ) const
inline

◆ get_sign()

bool ieee_floatt::get_sign ( ) const
inline

◆ increment()

void ieee_floatt::increment ( bool distinguish_zero = false)
inline

◆ is_double()

bool ieee_floatt::is_double ( ) const

◆ is_finite()

bool ieee_floatt::is_finite ( ) const
inline

◆ is_float()

bool ieee_floatt::is_float ( ) const

◆ is_infinity()

bool ieee_floatt::is_infinity ( ) const
inline

◆ is_NaN()

bool ieee_floatt::is_NaN ( ) const
inline

◆ is_negative()

bool ieee_floatt::is_negative ( ) const
inline

◆ is_normal()

bool ieee_floatt::is_normal ( ) const

◆ is_zero()

bool ieee_floatt::is_zero ( ) const
inline

◆ make_fltmax()

void ieee_floatt::make_fltmax ( )

◆ make_fltmin()

void ieee_floatt::make_fltmin ( )

◆ make_minus_infinity()

void ieee_floatt::make_minus_infinity ( )

◆ make_NaN()

void ieee_floatt::make_NaN ( )

◆ make_plus_infinity()

void ieee_floatt::make_plus_infinity ( )

◆ make_zero()

void ieee_floatt::make_zero ( )
inline

◆ minus_infinity()

ieee_floatt ieee_floatt::minus_infinity ( const ieee_float_spect & _spec)
inlinestatic

◆ NaN()

ieee_floatt ieee_floatt::NaN ( const ieee_float_spect & _spec)
inlinestatic

◆ negate()

void ieee_floatt::negate ( )
inline

◆ next_representable()

void ieee_floatt::next_representable ( bool greater)
protected

◆ operator*=()

ieee_floatt & ieee_floatt::operator*= ( const ieee_floatt & other)

◆ operator+=()

ieee_floatt & ieee_floatt::operator+= ( const ieee_floatt & other)

◆ operator-()

ieee_floatt & ieee_floatt::operator- ( )

◆ operator-=()

ieee_floatt & ieee_floatt::operator-= ( const ieee_floatt & other)

◆ operator/=()

ieee_floatt & ieee_floatt::operator/= ( const ieee_floatt & other)

◆ pack()

BigInt ieee_floatt::pack ( ) const

◆ plus_infinity()

ieee_floatt ieee_floatt::plus_infinity ( const ieee_float_spect & _spec)
inlinestatic

◆ print()

void ieee_floatt::print ( std::ostream & out) const

◆ set_sign()

void ieee_floatt::set_sign ( bool _sign)
inline

◆ to_ansi_c_string()

std::string ieee_floatt::to_ansi_c_string ( ) const
inline

◆ to_double()

double ieee_floatt::to_double ( ) const

◆ to_expr()

constant_exprt ieee_floatt::to_expr ( ) const

◆ to_float()

float ieee_floatt::to_float ( ) const

◆ to_integer()

BigInt ieee_floatt::to_integer ( ) const

◆ to_string_decimal()

std::string ieee_floatt::to_string_decimal ( unsigned precision) const

◆ to_string_scientific()

std::string ieee_floatt::to_string_scientific ( unsigned precision) const

◆ unpack()

void ieee_floatt::unpack ( const BigInt & i)

◆ operator!=

bool operator!= ( const ieee_floatt & a,
const ieee_floatt & b )
friend

◆ operator+

ieee_floatt operator+ ( const ieee_floatt & lhs,
const ieee_floatt & rhs )
friend

◆ operator-

ieee_floatt operator- ( const ieee_floatt & lhs,
const ieee_floatt & rhs )
friend

◆ operator< [1/2]

bool operator< ( const ieee_floatt & a,
const ieee_floatt & b )
friend

◆ operator< [2/2]

bool operator< ( const ieee_floatt & a,
int i )
friend

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const ieee_floatt & f )
friend

◆ operator<= [1/2]

bool operator<= ( const ieee_floatt & a,
const ieee_floatt & b )
friend

◆ operator<= [2/2]

bool operator<= ( const ieee_floatt & a,
int i )
friend

◆ operator== [1/2]

bool operator== ( const ieee_floatt & a,
const ieee_floatt & b )
friend

◆ operator== [2/2]

bool operator== ( const ieee_floatt & a,
int i )
friend

◆ operator> [1/2]

bool operator> ( const ieee_floatt & a,
const ieee_floatt & b )
friend

◆ operator> [2/2]

bool operator> ( const ieee_floatt & a,
int i )
friend

◆ operator>= [1/2]

bool operator>= ( const ieee_floatt & a,
const ieee_floatt & b )
friend

◆ operator>= [2/2]

bool operator>= ( const ieee_floatt & a,
int i )
friend

Member Data Documentation

◆ exponent

BigInt ieee_floatt::exponent
protected

◆ fraction

BigInt ieee_floatt::fraction
protected

◆ infinity_flag

bool ieee_floatt::infinity_flag
protected

◆ NaN_flag

bool ieee_floatt::NaN_flag
protected

◆ rounding_mode

rounding_modet ieee_floatt::rounding_mode

◆ sign_flag

bool ieee_floatt::sign_flag
protected

◆ spec

ieee_float_spect ieee_floatt::spec

The documentation for this class was generated from the following files: