Re: [cc65] preprocessor hazzle...

Date view Thread view Subject view

From: Ullrich von Bassewitz (
Date: 2002-09-28 22:02:37

I'm still working on my todo list, so...

On Wed, Jul 31, 2002 at 01:59:47AM +0200, groepaz wrote:
> that is, the runtime library appearently gets the result of the
> modulo-operation wrong - the sign of the remainder to be exact. i have
> checked with gcc (uhmz, to lazy to search for any proper definition, i
> believe in gcc for that matter ;=P) and it shows that
> sign(a % b) == sign (a)
> the current implementation applies the same rules to the
> modulo-operation as to the division/multiplication here, thus getting
> the wrong result in 3 of 4 cases ;=P

I've checked this against the C99 standard and gcc is (of course) right. The
words used in the standard are much more complicated, but they boil down to
what you have described above. I've changed the runtime routines accordingly.

Thanks for the report!



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-09-28 22:03:32 CEST