Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!columbia!cubmol!ping From: ping@cubmol.bio.columbia.edu (Shiping Zhang) Newsgroups: comp.lang.c Subject: Re: log10(8) Message-ID: <1990Feb26.031254.11354@cubmol.bio.columbia.edu> Date: 26 Feb 90 03:12:54 GMT References: <3244@servax0.essex.ac.uk> Reply-To: ping@cubmol.bio.columbia.edu (Shiping Zhang) Organization: Dept. of Biology, Columbia Univ., New York, NY Lines: 17 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. log10() expects a double as its argument. So use 8.0 instead of 8. -ping