This is the mail archive of the
cygwin
mailing list for the Cygwin project.
printf does not print long long ints properly
- From: "Markus Hoenicka" <markus dot hoenicka at mhoenicka dot de>
- To: Daniel Jeliński <dumbass at wp dot pl>
- Cc: cygwin at cygwin dot com
- Date: Sat, 24 Jan 2004 20:53:12 +0100
- Subject: printf does not print long long ints properly
- References: <opr1877gqc89ubik@smtp.wp.pl>
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:
>
> #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
>
--
Markus Hoenicka
markus.hoenicka@cats.de
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de
--
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/