# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Float16 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Float16 by rounding
+ float(value).
+ """
cdef cfloat.ui64_double ud
cdef cfloat.float64_t d
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Float32 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Float32 by rounding
+ float(value).
+ """
cdef cfloat.ui64_double ud
cdef cfloat.float64_t d
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Float64 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Float64 from
+ float(value).
+ """
cdef cfloat.ui64_double ud
cdef cfloat.float64_t d
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Posit8 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Posit8 by rounding
+ float(value).
+ """
if isinstance(value, int):
self._c_posit.v = value
else:
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Quire8 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Quire8 by rounding
+ float(value) to a Posit8.
+ """
if isinstance(value, int):
self._c_quire.v = value
else:
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Posit16 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Posit16 by rounding
+ float(value).
+ """
if isinstance(value, int):
self._c_posit.v = value
else:
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Quire16 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Quire16 by rounding
+ float(value) to a Posit16.
+ """
if isinstance(value, int):
for idx in range(1, -1, -1):
self._c_quire.v[idx] = value & 0xffffffffffffffff
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Posit32 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Posit32 by rounding
+ float(value).
+ """
if isinstance(value, int):
self._c_posit.v = value
else:
# convenience interface for use inside Python
def __init__(self, value):
+ """Given an int, create a Quire32 from the bitpattern represented by
+ that int. Otherwise, given some value, create a Quire32 by rounding
+ float(value) to a Posit32.
+ """
if isinstance(value, int):
for idx in range(7, -1, -1):
self._c_quire.v[idx] = value & 0xffffffffffffffff