Rational
- class pyarts.arts.Rational(*args, **kwargs)
Holds a rational number as two
Index
n / dOverview
Method
Read variable from file
Method
Saves variable to file
Static Method
Create variable from file
Attribute
int
DenominatorAttribute
int
NumeratorOperator
__add__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Operator
__eq__(self, arg: pyarts.arts.Rational, /) -> bool
Operator
__ge__(self, arg: pyarts.arts.Rational, /) -> bool
Operator
__gt__(self, arg: pyarts.arts.Rational, /) -> bool
Operator
Return hash(self).
Operator
__iadd__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Operator
__imul__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Operator
__isub__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Operator
__itruediv__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Operator
__le__(self, arg: pyarts.arts.Rational, /) -> bool
Operator
__lt__(self, arg: pyarts.arts.Rational, /) -> bool
Operator
__mul__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Operator
__ne__(self, arg: pyarts.arts.Rational, /) -> bool
Operator
__radd__(self, arg: int, /) -> pyarts.arts.Rational
Operator
__rmul__(self, arg: int, /) -> pyarts.arts.Rational
Operator
__rsub__(self, arg: int, /) -> pyarts.arts.Rational
Operator
__rtruediv__(self, arg: int, /) -> pyarts.arts.Rational
Operator
__truediv__(self, arg: pyarts.arts.Rational, /) -> pyarts.arts.Rational
Constructors
- __init__(self, n: int = 0, d: int = 1) None
- __init__(self, arg: str, /) None
- __init__(self) None
- __init__(self, arg: pyarts.arts.Rational) None
Overloaded function.
__init__(self, n: int = 0, d: int = 1) -> None
Default rational
__init__(self, arg: str, /) -> None
From
str
__init__(self) -> None
__init__(self, arg: pyarts.arts.Rational) -> None
Methods
- readxml(self, file: str) None
Read variable from file
- Parameters:
file (str) – A file that can be read
- On Error:
Throws RuntimeError for any failure to read
- savexml(self, file: str, type: str = 'ascii', clobber: bool = True) None
Saves variable to file
- Parameters:
- On Error:
Throws RuntimeError for any failure to save
Static Methods
- fromxml(file: str) pyarts.arts.Rational
Create variable from file
- Parameters:
file (str) – A file that can be read
- On Error:
Throws RuntimeError for any failure to read
Attributes
Operators
- __add__(self, arg: int, /) pyarts.arts.Rational
- __add__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational
- __eq__(self, arg: int, /) bool
- __eq__(self, arg: int, /) bool
- __eq__(self, arg: pyarts.arts.Rational, /) bool
- __ge__(self, arg: int, /) bool
- __ge__(self, arg: int, /) bool
- __ge__(self, arg: pyarts.arts.Rational, /) bool
- __gt__(self, arg: int, /) bool
- __gt__(self, arg: int, /) bool
- __gt__(self, arg: pyarts.arts.Rational, /) bool
- __hash__()
Return hash(self).
- __iadd__(self, arg: int, /) pyarts.arts.Rational
- __iadd__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational
- __imul__(self, arg: int, /) pyarts.arts.Rational
- __imul__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational
- __isub__(self, arg: int, /) pyarts.arts.Rational
- __isub__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational
- __itruediv__(self, arg: int, /) pyarts.arts.Rational
- __itruediv__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational
- __le__(self, arg: int, /) bool
- __le__(self, arg: int, /) bool
- __le__(self, arg: pyarts.arts.Rational, /) bool
- __lt__(self, arg: int, /) bool
- __lt__(self, arg: int, /) bool
- __lt__(self, arg: pyarts.arts.Rational, /) bool
- __mul__(self, arg: int, /) pyarts.arts.Rational
- __mul__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational
- __ne__(self, arg: int, /) bool
- __ne__(self, arg: int, /) bool
- __ne__(self, arg: pyarts.arts.Rational, /) bool
- __radd__(self, arg: int, /) pyarts.arts.Rational
- __rmul__(self, arg: int, /) pyarts.arts.Rational
- __rsub__(self, arg: int, /) pyarts.arts.Rational
- __rtruediv__(self, arg: int, /) pyarts.arts.Rational
- __truediv__(self, arg: int, /) pyarts.arts.Rational
- __truediv__(self, arg: pyarts.arts.Rational, /) pyarts.arts.Rational