Belle II Software  release-05-01-25
RealVariable Class Reference
Inheritance diagram for RealVariable:
Collaboration diagram for RealVariable:

Public Member Functions

def format_value (self, value, check=True)
 

Public Attributes

 ident
 Identifier used in VCD output stream.
 
 type
 VCD variable type; one of :const:VCDWriter.VAR_TYPES.
 
 size
 Size, in bits, of variable.
 

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 517 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 527 of file writer.py.

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

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