Skip to content

Commit b7cae64

Browse files
committed
document FatRat
1 parent 3d6fb61 commit b7cae64

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/FatRat.pod

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=begin pod
2+
3+
=TITLE class FatRat
4+
5+
class FatRat is Cool does Rational[Int, Int]
6+
7+
A C<FatRat> is a rational number stored with arbitrary size numerator and
8+
denominator. Arithmetic operations involving a C<FatRat> and optionally L<Int>
9+
or L<Rat> objects return a C<FatRat>, avoiding loss of precision.
10+
11+
Since, unlike L<Rat>, FatRat arithmetics do not fall back L<Num> at some
12+
point, there is a risk that repeated arithmetic operations generate
13+
pathologically large numerators and denominators.
14+
15+
There are two common ways to generate C<FatRat> objects: through the
16+
C<FatRat.new(Int, Int)> constructor, which generates them from numerator and
17+
denominator, or by calling the C<.FatRat> method on an L<Int> or L<Rat>
18+
object.
19+
20+
=end pod

0 commit comments

Comments
 (0)