Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: dik@cwi.nl (Dik T. Winter)
Subject: Re: printf-problem
Date: 1996/01/18	[thread overview]
Message-ID: <DLDs8G.JJ9@cwi.nl> (raw)
In-Reply-To: 821915961snz@genesis.demon.co.uk

In article <821915961snz@genesis.demon.co.uk> fred@genesis.demon.co.uk writes:
 > In article <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>
 >            wist@lam.mw.tu-muenchen.de "Henrik Wist" writes:
 > >long int zahl;   /* which is e.g. 10000500001 */
 > >printf("%d\n",zahl);      /* gives 1410565409, which is definitly wrong */
 > >.
 > >
 > >Is that a problem of printf() or DG-UX or is it my problem that I don't know
 > >the right conversion for printf(). Btw, printf("%u",zahl) didn't work either.
 > RTFM. 'man printf' will almost certainly tell you that the conversion
 > specifier for longs is %ld.

Alas, the FM will not tell him that the value is too large and does not
fit in the variable zahl, so only the lower 32 bits are retained.
-- 
dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland, +31205924098
home: bovenover 215, 1025 jn  amsterdam, nederland; http://www.cwi.nl/~dik/



  reply	other threads:[~1996-01-18  5:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-01-17  5:00 printf-problem Henrik Wist
1996-01-17  5:00 ` printf-problem P.Bennett
1996-01-17  5:00   ` printf-problem The Amorphous Mass
1996-01-17  5:00 ` printf-problem Alun Champion
1996-01-17  5:00 ` printf-problem Lawrence Kirby
1996-01-18  5:00   ` Dik T. Winter [this message]
1996-01-18  5:00 ` printf-problem Henrik Wist
1996-01-19  5:00 ` printf-problem Achim Reeh
1996-01-22  5:00   ` printf-problem Norman Gaywood
  -- strict thread matches above, loose matches on Subject: below --
1996-01-17  5:00 printf-problem The Amorphous Mass
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox