Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[S03] note that $x div $y == floor($x/$y) does not always hold
  • Loading branch information
moritz committed Apr 9, 2012
1 parent 228a486 commit 7ed1788
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions S03-operators.pod
Expand Up @@ -15,7 +15,7 @@ Synopsis 3: Perl 6 Operators
Created: 8 Mar 2004

Last Modified: 9 Apr 2012
Version: 244
Version: 245

=head1 Overview

Expand Down Expand Up @@ -772,12 +772,16 @@ general, other operators that might fail should also consider their
use in hyperops and junctions, and whether they can profitably benefit
from a lazy exception model.)

In general, C<div> should give the same result as
In general, C<div> should give the same result as

$x div $y == floor($x/$y);
$x div $y == floor($x/$y)

but the return value should be the same type as $x.

This identity stops to hold when C<$x/$y> degrades to a C<Num> and runs
into precision limits. A C<div> operation on two C<Int> objects must always
be done precisely.

=item *

C<< infix:<%> >>, modulo
Expand Down

0 comments on commit 7ed1788

Please sign in to comment.