Change 33328 by [EMAIL PROTECTED] on 2008/02/18 11:10:13

        Subject: Modulo operator and floating point numbers
        From: "Ken Williams" <[EMAIL PROTECTED]>
        Date: Sat, 16 Feb 2008 23:22:15 -0600
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/pod/perlop.pod#170 edit

Differences ...

==== //depot/perl/pod/perlop.pod#170 (text) ====
Index: perl/pod/perlop.pod
--- perl/pod/perlop.pod#169~33257~      2008-02-08 07:30:32.000000000 -0800
+++ perl/pod/perlop.pod 2008-02-18 03:10:13.000000000 -0800
@@ -260,9 +260,11 @@
 Binary "/" divides two numbers.
 X</> X<slash>
 
-Binary "%" computes the division remainder of two numbers.  Given integer
+Binary "%" is the modulo operator, which computes the division
+remainder of its first argument with respect to its second argument.
+Given integer
 operands C<$a> and C<$b>: If C<$b> is positive, then C<$a % $b> is
-C<$a> minus the largest multiple of C<$b> that is not greater than
+C<$a> minus the largest multiple of C<$b> less than or equal to
 C<$a>.  If C<$b> is negative, then C<$a % $b> is C<$a> minus the
 smallest multiple of C<$b> that is not less than C<$a> (i.e. the
 result will be less than or equal to zero).  If the operands
@@ -273,14 +275,14 @@
 If the absolute value of the right operand (C<abs($b)>) is greater than
 or equal to C<(UV_MAX + 1)>, "%" computes the floating-point remainder
 C<$r> in the equation C<($r = $a - $i*$b)> where C<$i> is a certain
-integer that makes C<$r> should have the same sign as the right operand
+integer that makes C<$r> have the same sign as the right operand
 C<$b> (B<not> as the left operand C<$a> like C function C<fmod()>)
 and the absolute value less than that of C<$b>.
 Note that when C<use integer> is in scope, "%" gives you direct access
-to the modulus operator as implemented by your C compiler.  This
+to the modulo operator as implemented by your C compiler.  This
 operator is not as well defined for negative operands, but it will
 execute faster.
-X<%> X<remainder> X<modulus> X<mod>
+X<%> X<remainder> X<modulo> X<mod>
 
 Binary "x" is the repetition operator.  In scalar context or if the left
 operand is not enclosed in parentheses, it returns a string consisting
End of Patch.

Reply via email to