Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: log10(8) Message-ID: <16036@haddock.ima.isc.com> Date: 26 Feb 90 20:29:32 GMT References: <3244@servax0.essex.ac.uk> <1990Feb26.031254.11354@cubmol.bio.columbia.edu> <90057.130433CMH117@psuvm.psu.edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 16 In article <90057.130433CMH117@psuvm.psu.edu> CMH117@psuvm.psu.edu (Charles Hannum) writes: >You may also have to change the printf() to: > printf("%lf", l); No. "%f" is the correct printf format for double; "%lf" is undefined. Backward compatibility strikes again. (In an ideal world, the three floating-point sizes would be called "short float", "float", and "long float", and their printf/scanf formats would be "%hf", "%f", and "%lf". Unfortunately, for historical reasons the types are "float", "double", and "long double", their scanf formats are "%f", "%lf", and "%Lf", and their printf formats are , "%f", and "%Lf". There is no printf format for float, since one cannot directly pass floats by value to a variadic function.) Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint