From 89b4f0ad099d4e64724f226448952d6442fa0c51 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 15 May 2006 16:43:44 +0000 Subject: [PATCH] Clarification on what Perl does to floating points in the modulus operation. p4raw-id: //depot/perl@28200 --- pod/perlop.pod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.7.4