classFatRatisCooldoesRational[Int,Int] {}

A FatRat is a rational number stored with arbitrary size numerator and denominator. Arithmetic operations involving a FatRat and optionally Int or Rat objects return a FatRat, avoiding loss of precision.

Since, unlike Rat, FatRat arithmetics do not fall back Num at some point, there is a risk that repeated arithmetic operations generate pathologically large numerators and denominators.

There are two common ways to generate FatRat objects: through the FatRat.new(Int, Int) constructor, which generates them from numerator and denominator, or by calling the .FatRat method on an Int or Rat object.

Methods§

method raku§

multimethodraku(FatRat:D: --> Str:D)

Returns an implementation-specific string that produces an equivalent object when given to EVAL.

sayFatRat.new(1, 2).raku; # OUTPUT: «FatRat.new(1, 2)␤» 

Typegraph§

Type relations for FatRat
raku-type-graphFatRatFatRatCoolCoolFatRat->CoolRationalRationalFatRat->RationalMuMuAnyAnyAny->MuCool->AnyNumericNumericRealRealReal->NumericRational->Real

Expand chart above

close