Why is modulus different in different programming languages?

Posted by boost on Stack Overflow See other posts from Stack Overflow or by boost
Published on 2009-01-16T13:31:27Z Indexed on 2010/04/30 15:47 UTC
Read the original article Hit count: 187

Filed under:
|
|
|

Perl

print 2 % -18;

-->

-16

Tcl

puts [expr {2 % -18}]

-->

-16

but VBScript

wscript.echo 2 mod -18

-->

2

Why the difference?

© Stack Overflow or respective owner

Related posts about perl

Related posts about tcl