Author: Dieter Buerssner
Date: 14:01:02 06/07/04
Go up one level in this thread
On June 07, 2004 at 13:58:18, Robert Hyatt wrote: >On June 07, 2004 at 13:13:33, Vincent Diepeveen wrote: >>The rule in ansi-C should read that for constants assigned, they should be >>assumed to have the same type and not that they should be assumed to be integer. I think, they way the Standard C defines it is fine. See also Heiner's point about macros, where things may be not that obviously constant. > >That won't work. i = .1 * 20.0; would produce errors if you convert .1 and 20.0 >to integers first, then do the multiply. > >_NO_ compiler will think that 1 << 36 is anything but zero on an architecture >where int == 32 bits. Making them do so would break more programs than it would >help. Perhaps there are too many negations for my comprehension :-) Many compilers, will give int a=1, b=36; /* Do things, that will not allow the optimizer to do evaluate this a constant expression, as */ c = a<<b; /* c=a<<(b%32)=16 */ Regards, Dieter
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.