From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
Subject: Re: Anyone using drand48()?
Date: Wed, 25 Feb 1998 08:04:59 -0700 (MST) [thread overview]
Message-ID: <199802251504.IAA22929@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <Pine.LNX.3.96.451113233133.949C-100000@bec.physics.udel.edu>
Jonathan DuBois writes:
>
> and printf("%.8f %.8f\n",x,y); should be
> printf("%.8lf %.8lf\n",x,y);
Just for the record. There is no 'l' modifier on printf 'f' format
specifier (there is one for (f)scanf and maybe this what mixed you up).
'f' in the context means "double". The above "should" is a BUG and gcc
will warn you about it.
The Standard says "If an h, l or L appears with any other conversion
specifier , the behaviour is udefined". In case of 'l' "any" means
everything but d, i, o, u, x and X.
Most compilers/libraries are acommodating enough and will simply
interpret "%.8lf" as "%.8f", silently or complaining, but they are free
to do **anything** and still remain Standard conforming.
OTOH "Lf" conversion does exist but this is another story.
Michal
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next parent reply other threads:[~1998-02-25 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.96.451113233133.949C-100000@bec.physics.udel.edu>
1998-02-25 15:04 ` Michal Jaegermann [this message]
1998-02-25 11:21 Anyone using drand48()? Uncle George
-- strict thread matches above, loose matches on Subject: below --
1998-02-25 10:51 Johannes G.D. Hausmann
[not found] <34F3F7C2.F09@neuro.uni-oldenburg.de>
1998-02-25 7:12 ` Jonathan L Dubois
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