qudi.util.units.ScaledFloat
- class qudi.util.units.ScaledFloat(x=0, /)[source]
Bases:
builtins.floatFormat code ‘r’ for scaled output.
- __init__(*args, **kwargs)
Methods
__init__(*args, **kwargs)Return integer ratio.
conjugate(/)Return self, the complex conjugate of any float.
fromhex(string, /)Create a floating-point number from a hexadecimal string.
hex(/)Return a hexadecimal representation of a floating-point number.
is_integer(/)Return True if the float is an integer.
Attributes
the imaginary part of a complex number
the real part of a complex number
Returns the scale.
Returns the scale value which can be used to devide the actual value
- __format__(fmt)[source]
Fromats the string using format fmt.
r for scaled output.
- Parameters:
- fmtstr
format string
- as_integer_ratio(/)
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original float and with a positive denominator.
Raise OverflowError on infinities and a ValueError on NaNs.
>>> (10.0).as_integer_ratio() (10, 1) >>> (0.0).as_integer_ratio() (0, 1) >>> (-.25).as_integer_ratio() (-1, 4)
- conjugate(/)
Return self, the complex conjugate of any float.
- fromhex(string, /)
Create a floating-point number from a hexadecimal string.
>>> float.fromhex('0x1.ffffp10') 2047.984375 >>> float.fromhex('-0x1p-1074') -5e-324
- hex(/)
Return a hexadecimal representation of a floating-point number.
>>> (-0.1).hex() '-0x1.999999999999ap-4' >>> 3.14159.hex() '0x1.921f9f01b866ep+1'
- imag
the imaginary part of a complex number
- is_integer(/)
Return True if the float is an integer.
- real
the real part of a complex number
- property scale
Returns the scale. (No prefix if 0)
- property scale_val
Returns the scale value which can be used to devide the actual value