delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/10/16:34:28

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Floating Point???
Date: Mon, 10 Mar 1997 08:25:07 -0800
Organization: Alcyone Systems
Lines: 20
Message-ID: <332435E3.3E926831@alcyone.com>
References: <4b5_9703051119 AT softtech DOT brisnet DOT org DOT au> <5fin95$f8 AT news DOT ox DOT ac DOT uk>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

George Foot wrote:

> `float' numbers aren't that accurate; use `double's instead. Replace
> `float'
> with `double' throughout, and change `%.12f' to `%.12lf', and you should
> get
> the right answer.

The %.12f is correct; floats are automatically promoted to doubles in
function calls.  %f is the printf specifier for double; there's only a
distinction between %f and %lf for floats and doubles, respectively, in
scanf.

-- 
       Erik Max Francis, &tSftDotIotE / email:  max AT alcyone DOT com
                     Alcyone Systems /    web:  http://www.alcyone.com/max/
San Jose, California, United States /    icbm:  37 20 07 N  121 53 38 W
                                   \
              "I am become death, / destroyer of worlds."
                                 / J. Robert Oppenheimer (quoting legend)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019