Re: MATH_MOD: Include in GLib?
- From: Sven Neumann <sven gimp org>
- To: drlion-dated-1091422376 bbd5a3 deepwood net
- Cc: gtk-devel-list gnome org
- Subject: Re: MATH_MOD: Include in GLib?
- Date: 28 Jul 2004 12:33:39 +0200
Hi,
Daniel Brockman <drlion deepwood net> writes:
> > > Also note that your suggest macro won't work if x < m.
>
> What do you mean? Assuming that x % m == -(-x % m) whenever x < 0
> (which is allegedly machine-dependent), it works in all these cases,
> as far as I can tell, and x < m in all of them:
The behaviour for negative operands is by definition undefined. This
it doesn't make sense to make any assumptions about it. Any macro that
passes a negative operand to the C modulo operator is broken. No
matter how well it may seem to work.
Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]