log10(8)
Michael Meissner
meissner at osf.org
Wed Feb 28 02:45:52 AEST 1990
In article <1460 at amethyst.math.arizona.edu> raw at math.arizona.edu (Rich
Walters) writes:
| 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.
| >
|
| Try printf"%lf",l); after all l is declared to be a double!!!!!!!!
Sigh. Printf is a varargs function. This means that there is no way
a 'float' can be passed to it. Thus %f and %lf are synomous.....
--
Michael Meissner email: meissner at osf.org phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA
Catproof is an oxymoron, Childproof is nearly so
More information about the Comp.lang.c
mailing list