erg/crates/erg_compiler/lib/pystd/fractions.d.er
2024-03-05 22:48:05 +09:00

20 lines
704 B
Python

decimal = pyimport "decimal"
.Fraction: ClassType
.Fraction <: Eq
.Fraction <: Hash
.Fraction <: Ord
.Fraction.
numerator: Int
denominator: Int
__call__: \
((numerator := Int, denominator := Int) -> .Fraction) \
and ((string: decimal.Decimal) -> .Fraction) \
and (string: Str) -> .Fraction
as_integer_ratio: (self: .Fraction) -> (Int, Int)
from_float: (float: Float) -> .Fraction
from_decimal: (decimal: decimal.Decimal) -> .Fraction
limit_denominator: (self: .Fraction, max_denominator := Int) -> .Fraction
__floor__: (self: .Fraction) -> Int
__ceil__: (self: .Fraction) -> Int
__round__: (self: .Fraction, ndights := Int) -> Int