Skip to content

Commit

Permalink
[S03] Rat**UInt also tries to stay in Rat-space
Browse files Browse the repository at this point in the history
Make it clear that a Rat raised to a positive integral power also should
try to preserve exactitude as long as Rat can support it.  (Currently
Rat is specced to be Int/uint64, though rakudo does not yet do that.)
  • Loading branch information
TimToady committed Sep 12, 2010
1 parent 7e40979 commit 3b9260b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions S03-operators.pod
Expand Up @@ -15,8 +15,8 @@ Synopsis 3: Perl 6 Operators

Created: 8 Mar 2004

Last Modified: 7 Sep 2010
Version: 216
Last Modified: 11 Sep 2010
Version: 217

=head1 Overview

Expand Down Expand Up @@ -575,10 +575,12 @@ Unless the right argument is a non-negative integer the result is likely to
be an approximation. If the right argument is of an integer type,
exponentiation is at least as accurate as repeated multiplication on
the left side's type. (From which it can be deduced that C<Int**UInt>
is always exact, since C<Int> supports arbitrary precision.) If the
is always exact, since C<Int> supports arbitrary precision.
C<Rat**UInt> is accurate to the precision of C<Rat>.) If the
right argument is an integer represented in a non-integer type, the
accuracy is left to implementation provided by that type; there is
no requirement to recognize an integer to give it special treatment.
(Coercion of an integer C<Str> via C<Cool> is likely to do the right thing, however.)

=back

Expand Down

0 comments on commit 3b9260b

Please sign in to comment.