commonpower.modeling.util.SubscriptableFloat

class SubscriptableFloat(x=0, /)[source]

Bases: float

This is a dummy class to “fake” the behaviour of a model element when extracting the signature from a constraint/cost expression.

Methods

as_integer_ratio

Return integer ratio.

conjugate

Return self, the complex conjugate of any float.

fromhex

Create a floating-point number from a hexadecimal string.

hex

Return a hexadecimal representation of a floating-point number.

is_indexed

is_integer

Return True if the float is an integer.

Attributes

imag

the imaginary part of a complex number

lb

real

the real part of a complex number

ub