FloatEnum#
- class mrinufft.trajectories.FloatEnum(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
An Enum for float that is case insensitive for ist attributes.
Methods
Return self, the complex conjugate of any float.
Return a pair of integers, whose ratio is exactly equal to the original float.
Create a floating-point number from a hexadecimal string.
Return a hexadecimal representation of a floating-point number.
Return True if the float is an integer.
__init__Attributes
- as_integer_ratio()[source]#
Return a pair of integers, whose ratio is exactly equal to the original float.
The ratio is in lowest terms and has 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)
- classmethod fromhex(string, /)[source]#
Create a floating-point number from a hexadecimal string.
>>> float.fromhex('0x1.ffffp10') 2047.984375 >>> float.fromhex('-0x1p-1074') -5e-324