| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| From: | "Markus Hoenicka" <markus DOT hoenicka AT mhoenicka DOT de> |
| MIME-Version: | 1.0 |
| Message-ID: | <16402.52520.387374.148076@tipi.mininet> |
| Date: | Sat, 24 Jan 2004 20:53:12 +0100 |
| To: | =?iso-8859-2?B?RGFuaWVsIEplbGnxc2tp?= <dumbass AT wp DOT pl> |
| Cc: | cygwin AT cygwin DOT com |
| Subject: | printf does not print long long ints properly |
| In-Reply-To: | <opr1877gqc89ubik@smtp.wp.pl> |
| References: | <opr1877gqc89ubik AT smtp DOT wp DOT pl> |
| X-IsSubscribed: | yes |
| X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id i0OJtRQM003928 |
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 DOT hoenicka AT cats DOT 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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |