log10(8)
Charles Hannum
CMH117 at psuvm.psu.edu
Tue Feb 27 05:04:33 AEST 1990
In article <1990Feb26.031254.11354 at cubmol.bio.columbia.edu>,
ping at cubmol.bio.columbia.edu (Shiping Zhang) says:
>
>In article <3244 at servax0.essex.ac.uk> elzea at sersun0.essex.ac.uk (El-Zein A A)
>writes:
>
>> My calculator gives me 0.9030899 for log(8),
>> While the following code (which I thought would
>> give me the above value of 0.9030899) prints
>> -312.770165.
> .
>> double l;
>
>> l = log10(8);
>> printf("%f", l);
>
>> Can anybody tell me why.
>log10() expects a double as its argument. So use 8.0 instead of 8.
>
You may also have to change the printf() to:
printf("%lf", l);
Virtually,
- Charles Martin Hannum II "Klein bottle for sale ... inquire within."
(That's Charles to you!) "To life immortal!"
cmh117 at psuvm.{bitnet,psu.edu} "No noozzzz izzz netzzzsnoozzzzz..."
c9h at psuecl.{bitnet,psu.edu} "Mem'ry, all alone in the moonlight ..."
More information about the Comp.lang.c
mailing list