Belle II Software development
RealVariable Class Reference
Inheritance diagram for RealVariable:
Variable

Public Member Functions

def format_value (self, value, check=True)
 

Static Private Attributes

tuple __slots__ = ()
 variables
 

Detailed Description

Real (IEEE-754 double-precision floating point) variable.

Values must be numeric and cannot be 'x' or 'z' states.

Definition at line 512 of file writer.py.

Member Function Documentation

◆ format_value()

def format_value (   self,
  value,
  check = True 
)
Format real value change for VCD stream.

:param value: Numeric changed value.
:param type: float or int
:raises ValueError: for invalid real *value*.
:returns: string representing value change for use in a VCD stream.

Reimplemented from Variable.

Definition at line 522 of file writer.py.

522 def format_value(self, value, check=True):
523 """Format real value change for VCD stream.
524
525 :param value: Numeric changed value.
526 :param type: float or int
527 :raises ValueError: for invalid real *value*.
528 :returns: string representing value change for use in a VCD stream.
529
530 """
531 if not check or isinstance(value, Number):
532 return f'r{value:.16g} {self.ident}'
533 else:
534 raise ValueError(f'Invalid real value ({value})')
535
536

Member Data Documentation

◆ __slots__

tuple __slots__ = ()
staticprivate

variables

Definition at line 520 of file writer.py.


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