Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |