delorie.com/archives/browse.cgi | search |
Date: | Tue, 12 Dec 1995 19:17:51 +0200 (IST) |
From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
To: | Erik Max Francis <max AT alcyone DOT darkside DOT com> |
Cc: | djgpp AT sun DOT soe DOT clarkson DOT edu |
Subject: | Re: header file <math.h> |
On Mon, 11 Dec 1995, Erik Max Francis wrote: > Andy Molyneux <molyneua AT cs DOT man DOT ac DOT uk> writes: > > > You're also using the wrong format character to printf; it should be "%f" > > not "%d" ("%d" is for ints, whereas "sin" returns a double) > > Technically, a double should be formatted as an %lf. Wrong. %lf only applies to scanf(); printf() converts all floats to doubles anyway, according to ANSI C, so %f is the way to go.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |