Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[S03] make infix:<%> be rational if possible
  • Loading branch information
Carl Masak committed Jun 6, 2014
1 parent 44dd6bd commit ca66483
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions S03-operators.pod
Expand Up @@ -14,8 +14,8 @@ Synopsis 3: Perl 6 Operators

Created: 8 Mar 2004

Last Modified: 04 Jun 2014
Version: 274
Last Modified: 06 Jun 2014
Version: 275

=head1 Overview

Expand Down Expand Up @@ -812,6 +812,10 @@ then calculates the remainder, which is defined as:

$x % $y == $x - floor($x / $y) * $y

If both operands are of integer or rational type, the operator returns the
corresponding C<Rat> value (except when the result does not fit into a
C<Rat>, as detailed in L<S02>).

=item *

C<< infix:<%%> >>, is divisible by
Expand Down

1 comment on commit ca66483

@colomon
Copy link
Contributor

@colomon colomon commented on ca66483 Jun 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of additional specificity here, but this language seems wrong to me. First, it seems like a very unexpected choice to have Int % Int to be a Rat, when the value is always going to be an integer. Second, surely FatRat % FatRat should be FatRat rather than Rat?

Unfortunately, I'm having a hard time thinking of better language for this...

Please sign in to comment.