remainder (%)
remainder `r = a % b`, `r` has the same sign as `a`.
Last updated
Was this helpful?
remainder `r = a % b`, `r` has the same sign as `a`.
Last updated
Was this helpful?
⟩ ⟩ ⟩ remainder (%)
a
%
b
returns
, if one of the operands is /a
= ± / b
= ±0.
a
, if a
= ±0 /b
= ±.
r
=
a
-
b
*
q
where:
q
is the integer such that:
r
has the same sign asa
, while being as close to 0 as possible.
remainder (%) and are different remainder vs. modulo vs. mod
% operator
works for floating-point numbers too.