Skip to content

Commit

Permalink
document FatRat
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Aug 10, 2012
1 parent 3d6fb61 commit b7cae64
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/FatRat.pod
@@ -0,0 +1,20 @@
=begin pod
=TITLE class FatRat
class FatRat is Cool does Rational[Int, Int]
A C<FatRat> is a rational number stored with arbitrary size numerator and
denominator. Arithmetic operations involving a C<FatRat> and optionally L<Int>
or L<Rat> objects return a C<FatRat>, avoiding loss of precision.
Since, unlike L<Rat>, FatRat arithmetics do not fall back L<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 C<FatRat> objects: through the
C<FatRat.new(Int, Int)> constructor, which generates them from numerator and
denominator, or by calling the C<.FatRat> method on an L<Int> or L<Rat>
object.
=end pod

0 comments on commit b7cae64

Please sign in to comment.