Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!asuvax!noao!amethyst!raw From: raw@math.arizona.edu (Rich Walters) Newsgroups: comp.lang.c Subject: Re: log10(8) Message-ID: <1460@amethyst.math.arizona.edu> Date: 27 Feb 90 02:58:48 GMT References: <3244@servax0.essex.ac.uk> Sender: news@amethyst.math.arizona.edu Organization: Dept. of Math., Univ. of Arizona, Tucson AZ 85721 Lines: 29 In article <3244@servax0.essex.ac.uk> elzea@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!!!!!!!! Richard Walter ------------------------------------------------------------------------------- Keep on crunching those numbers -------------------------------------------------------------------------------