Using SCANF with DOUBLE precision variables...

Don Kneller%Langridge kneller at ucsfcgl.UUCP
Mon Sep 29 17:18:50 AEST 1986


In article <22 at orion.UUCP> vaughan at orion.UUCP (Robert Vaughan) writes:
>>> I have been wanting to read in some real numbers, preferably thru SCANF
>>> ...
>>> declared as DOUBLE.  (...)
>
>double foo;
>
>	scanf("%lf",&foo);
>
Except, of course, in the infinite wisdom of Silicon Graphics whose
floats and doubles are the same size so one must use %f for both.  The
"justification" is that they have yet another floating point type called
long float with gets the %lf format.  It's painfully nonportable.  Sigh.
-- 
	Don Kneller
UUCP:	...ucbvax!ucsfcgl!kneller
ARPA:	kneller at cgl.ucsf.edu
BITNET:	kneller at ucsfcgl.BITNET



More information about the Comp.lang.c mailing list