Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rational
  • Loading branch information
moritz committed Jun 25, 2012
1 parent f6edbb6 commit 25a4b5f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/Rational.pod
@@ -0,0 +1,32 @@
=begin pod
=head1 Rational
role Rational[::NuT, ::DenomT] does Real { ... }
C<Rational> is the common role for numbers that are stored as pairs of
numerator and denominator. It is parameterized by the types of the numerator
and denominator.
Built into Perl 6 are L<Rat> and L<FatRat>, which both do the C<Rational> role.
=head2 methods
=head3 numerator
Returns the numerator.
=head3 denominator
Returns the denominator.
=head3 nude
Returns a list of the numerator and denominator.
=head3 norm
Returns a normalized Rational object, ie with positive denominator, and
numerator and denominator coprime.
=end pod

0 comments on commit 25a4b5f

Please sign in to comment.