log10(8)
Shiping Zhang
ping at cubmol.bio.columbia.edu
Mon Feb 26 14:12:54 AEST 1990
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.
-ping
More information about the Comp.lang.c
mailing list