Re: printf does not print long long ints properly

2004-01-25 Thread Gerrit P. Haase
Hallo Daniel, #include main() { long long i; i=100; i*=100; printf("%lld",i); return 0; } $ ./printf 1 Am Samstag, 24. Januar 2004 um 01:41 schriebst du: > when I compile the following program: > #include > main() > { > long long i; > i=100; > i*=100; > pr

printf does not print long long ints properly

2004-01-24 Thread Markus Hoenicka
Hi, I ran across a similar problem on OSX. It turned out to be a compiler bug. The workaround on that platform was to use an explicit cast in the argument list, i.e. something like: printf("%Ld",(long long)i); regards, Markus Daniel Jeliński writes: > when I compile the following program: >

Re: printf does not print long long ints properly

2004-01-23 Thread Rolf Campbell
"ll" is the long long prefix. Daniel Jeliński wrote: when I compile the following program: #include main() { long long i; i=100; i*=100; printf("%Ld",i); return 0; } I get the following: -727379968 instead of the expected 1 I am using gcc 3.3.1 the same code works nicely on l

Re: printf does not print long long ints properly

2004-01-23 Thread Peter Seebach
In message <[EMAIL PROTECTED]>, =?iso-8859-2?B?RGFuaWVsIEplbGnxc2tp?= writes: >I am using gcc 3.3.1 >the same code works nicely on linux machine with gcc 3.3.1 >is any other information necessary? What happens if you use %lld, which is what the standard specifies for long long, instead of the L

printf does not print long long ints properly

2004-01-23 Thread Daniel Jeliński
when I compile the following program: #include main() { long long i; i=100; i*=100; printf("%Ld",i); return 0; } I get the following: -727379968 instead of the expected 1 I am using gcc 3.3.1 the same code works nicely on linux machine with gcc 3.3.1 is any other information n