Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Data Fields
FPSortRef Class Reference

FP Sorts. More...

+ Inheritance diagram for FPSortRef:

Public Member Functions

def ebits
 
def sbits
 
def cast
 
- Public Member Functions inherited from SortRef
def as_ast
 
def get_id
 
def kind
 
def subsort
 
def cast
 
def name
 
def __eq__
 
def __ne__
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__
 
def __str__
 
def __repr__
 
def sexpr
 
def as_ast
 
def get_id
 
def ctx_ref
 
def eq
 
def translate
 
def hash
 
- Public Member Functions inherited from Z3PPObject
def use_pp
 

Data Fields

 ctx
 
- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

FP Sorts.

Floating-point sort.

Definition at line 7698 of file z3py.py.

Member Function Documentation

def cast (   self,
  val 
)
Try to cast `val` as a Floating-point expression

>>> b = FPSort(8, 24)
>>> b.cast(1.0)
1
>>> b.cast(1.0).sexpr()
'(fp #b0 #x7f #b00000000000000000000000)'

Definition at line 7717 of file z3py.py.

7718  def cast(self, val):
7719  """Try to cast `val` as a Floating-point expression
7720 
7721  >>> b = FPSort(8, 24)
7722  >>> b.cast(1.0)
7723  1
7724  >>> b.cast(1.0).sexpr()
7725  '(fp #b0 #x7f #b00000000000000000000000)'
7726  """
7727  if is_expr(val):
7728  if __debug__:
7729  _z3_assert(self.ctx == val.ctx, "Context mismatch")
7730  return val
7731  else:
7732  return FPVal(val, None, self, self.ctx)
7733 
def FPVal
Definition: z3py.py:8178
def is_expr
Definition: z3py.py:961
def ebits (   self)
Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
>>> b = FPSort(8, 24)
>>> b.ebits()
8

Definition at line 7701 of file z3py.py.

7702  def ebits(self):
7703  """Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
7704  >>> b = FPSort(8, 24)
7705  >>> b.ebits()
7706  8
7707  """
7708  return int(Z3_fpa_get_ebits(self.ctx_ref(), self.ast))
unsigned Z3_API Z3_fpa_get_ebits(Z3_context c, Z3_sort s)
Retrieves the number of bits reserved for the exponent in a FloatingPoint sort.
def ctx_ref
Definition: z3py.py:304
def sbits (   self)
Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
>>> b = FPSort(8, 24)
>>> b.sbits()
24

Definition at line 7709 of file z3py.py.

7710  def sbits(self):
7711  """Retrieves the number of bits reserved for the exponent in the FloatingPoint sort `self`.
7712  >>> b = FPSort(8, 24)
7713  >>> b.sbits()
7714  24
7715  """
7716  return int(Z3_fpa_get_sbits(self.ctx_ref(), self.ast))
unsigned Z3_API Z3_fpa_get_sbits(Z3_context c, Z3_sort s)
Retrieves the number of bits reserved for the significand in a FloatingPoint sort.
def ctx_ref
Definition: z3py.py:304

Field Documentation

ctx

Definition at line 7728 of file z3py.py.