The preprocessor handles strings, so it inserts "(3*4)".
The compiler, if smart enough, identifies 3*4 as a constant subexpression
and replaces it with 12 (If is _really_ dumb, it may assume that operators
are all alike and may all be handled as addition, thus replacing it with a
7).
regards
Niels HP,
[EMAIL PROTECTED]
> -----Original Message-----
> From: Clive Crous [mailto:[EMAIL PROTECTED]]
> Sent: 1. december 1999 11:53
> To: [EMAIL PROTECTED]
> Subject: [OT] Fixed Point Math ( was Re: semicircle )
>
>
> hmmmm
>
> I thought #define's where "pre-processed"
> ie
> i want to do this:
> ---
> #define MYDEF (3*4)
> ---
> and when i use "MYDEF" in the code it must put in a "7" not a "(3*4)"
> is there a way to do this ?
> why should I have computations done at run time, when they
> could be done at
> compile time
>
> thanks again
> Clive
>
>
>