steph1111 / PRECISE

Precision Rules Enforced Calculations In Scientific Environments
Other
0 stars 0 forks source link

sig_float: Create assignment overload function #24

Closed steph1111 closed 1 year ago

steph1111 commented 1 year ago

Function complete, do some testing on it

steph1111 commented 1 year ago
def __assign__(self, other):
    """
    Assigns an object to an object of type sig_float
    """
    if isinstance(other, sig_float):
      self._str = other._str
      self._sig_figs = other._sig_figs
      self._precision = other._precision
      self._float = other._float
      self._units = other._units
    else:
      self = sig_float(other)