on redhat

perl -e'print STDOUT (-1 % 12), "\n";'

yeilds 11

I thought php gave 11 but i tried it again and it is giving me -1.

php -r'echo (-1 % 12),"\n";'

Nuts.  Well, a math friend tells me that modulo operators are flakey
and that he always writes his own to make sure he knows what he will
get.

sigh

On Fri, Jul 15, 2011 at 5:25 PM, Alan Chaney <a...@mechnicality.com> wrote:
> What other languages?
>
> In Java '%' in this case means " the remainder of"
>
> the "remainder of " dividing -1 by 12 is -1, as is -13 %12 or -25 % 12.
>
> I'd be interested to know which other language does what you say.
>
> HTH
>
> Alan
>
>
> On 7/15/2011 3:07 PM, seven.reeds wrote:
>>
>> int x = 0;
>> int y = -1;
>> x = y % 12;
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to