From: Steve Peters Date: Mon, 15 May 2006 16:43:44 +0000 (+0000) Subject: Clarification on what Perl does to floating points in the modulus X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=89b4f0ad099d4e64724f226448952d6442fa0c51;p=p5sagit%2Fp5-mst-13.2.git Clarification on what Perl does to floating points in the modulus operation. p4raw-id: //depot/perl@28200 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 4dffa4f..93cf44a3 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -260,7 +260,9 @@ 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>. 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). +result will be less than or equal to zero). If the operands +C<$a> and C<$b> are floting point values, only the integer portion +of C<$a> and C<$b> will be used in the operation. Note that when C is in scope, "%" gives you direct access to the modulus operator as implemented by your C compiler. This operator is not as well defined for negative operands, but it will