This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: printf does not print long long ints properly


Hallo Daniel,


#include <stdio.h>
main()
{
 long long i;
 i=1000000;
 i*=1000000;
 printf("%lld",i);
 return 0;
}

$ ./printf
1000000000000



Am Samstag, 24. Januar 2004 um 01:41 schriebst du:

> when I compile the following program:

> #include <stdio.h>
> main()
> {
> long long i;
> i=1000000;
> i*=1000000;
> printf("%Ld",i);
> return 0;
> }

> I get the following:
> -727379968
> instead of the expected 1000000000000

> 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?



HTH,
Gerrit
-- 
=^..^=



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]