Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Outputting u64 word using printf?

Author: Robert Hyatt

Date: 09:06:00 06/07/04

Go up one level in this thread


On June 07, 2004 at 10:40:09, Fabien Letouzey wrote:

>On June 07, 2004 at 10:36:58, Vincent Diepeveen wrote:
>
>>On June 07, 2004 at 10:30:50, Fabien Letouzey wrote:
>
>>r = 1<<36; // works for good compilers not for the rest
>
>Hm, my understanding is that first "1<<36" should be calculated (so it's 0 if
>sizeof(int) <= 4) and *then* cast into r's type (oops, too late).
>
>Fabien.


That is correct...

cast the constant or get the wrong answer. :)

I don't know of _any_ compiler that will do that automatically unless the whole
thing is a 64 bit only configuration such as an alpha with DECs compiler.  A
cray gets it right too, but because ints are 64 bits to start with there...



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.