- or download this
C:\_32>perl -wle "$m = (2**113) - 1; $n = 2; print $m % $n;"
0
- or download this
C:\_32>perl -MPOSIX -wle "$m = (2**113) - 1; $n = 2; print fmod($m, $n
+);"
1
- or download this
Binary "%" is the modulo operator, which computes the division remaind
+er
of its first argument with respect to its second argument. Given integ
+er
...
Note that when "use integer" is in scope, "%" gives you direct access
+to
the modulo operator as implemented by your C compiler. This operator i
+s
not as well defined for negative operands, but it will execute faster.
- or download this
If $n is positive, then "$m % $n" is $m minus the largest multiple of
+$n less than or equal to $m.
....
...
$n (that is "abs($n)") is less than "(UV_MAX + 1)", only the integer
portion of $m and $n will be used in the operation (Note: here "UV_MAX
+"
means the maximum of the unsigned integer type)
- or download this
C:\_32>perl -wle "$r = 10384593717069655257060992658440191.0 - (519229
+6858534827628530496329220095.0 * 2); print $r;"
1
- or download this
C:\_32>perl -wle "$m = (2**113) - 1; $n = 2; print $m % $n;"
0
C:\_32>perl -MPOSIX -wle "$m = (2**113) - 1; $n = 2; print fmod($m, $n
+);"
1
- or download this
C:\>perl -wle "$m = (2**64) - 1; $n = 2; print $m % $n;"
0
C:\>perl -MPOSIX -wle "$m = (2**64) - 1; $n = 2; print fmod($m, $n);"
1
- or download this
C:\_32>perl -wle "$m = (2**53) - 1; $n = 2; print $m % $n;"
1
C:\_32>perl -MPOSIX -wle "$m = (2**53) - 1; $n = 2; print fmod($m, $n)
+;"
1