Using SCANF with DOUBLE precision variables...

DAVE%UWF.BITNET at WISCVM.WISC.EDU DAVE%UWF.BITNET at WISCVM.WISC.EDU
Wed Sep 10 05:57:26 AEST 1986


'Ello,
      I've been doing a little matrix algebra in C lately, and in the process
I have been wanting to read in some real numbers, preferably thru SCANF, but I
get nothing but 0.000 returned when i try to put the result of a SCANF in a var
declared as DOUBLE.  The only thing that I could think of was either writing my
own algorithm, or reading the number in as FLOAT and storing it in the DOUBLE
variable.  Perchance someone else has had this problem and found a better
solution without re-inventing several wheels?  I guess there really isn't any
reason why I just couldn't use FLOAT variables, but then there shouldn't be any
reason why I can't use SCANF on DOUBLE vars either.
      Thanks in advance,
                        Dave



More information about the Comp.lang.c mailing list