J
Jim Hunter
Hello all,
I have been reading K&R2, and it says that "the sign of the result for % [is]
machine-dependent for negative operands." Does this mean that the absolute
value of the result is guaranteed, but the sign isn't? Or does it mean that
(for example) -100 % 3 == -1 on some machines and 2 on others? The latter
behavior seems illogical to me, but I've been unable to find a definitive
statement about this.
Thanks in advance for satisfying my curiosity and for taking mercy on a
newsgroup newbie.
Jim
I have been reading K&R2, and it says that "the sign of the result for % [is]
machine-dependent for negative operands." Does this mean that the absolute
value of the result is guaranteed, but the sign isn't? Or does it mean that
(for example) -100 % 3 == -1 on some machines and 2 on others? The latter
behavior seems illogical to me, but I've been unable to find a definitive
statement about this.
Thanks in advance for satisfying my curiosity and for taking mercy on a
newsgroup newbie.
Jim