www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/07/06:55:20

To: haltmaye AT mathpool DOT uni-augsburg DOT de
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu, gnewman AT world DOT std DOT com
Subject: Re: DJGPP Floating Point Problem
Date: Tue, 07 Feb 95 08:50:07 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

> Format %f in printf expects a float while 100.0 is a double number.
> Try %lf or %g.

Please, PLEASE, guys, let's not post untested ``solutions''.
Whoever posts a problem with printf() is confused enough already.
Is it too much to ask to actually compile and run your proposed
solution before you post it?

In printf(), %f expects a double, not a float, and every float
is converted to double when passed to printf().  This is ANSI
behavior for any function with variable number of arguments.
The %lf/%f controversy is an issue in scanf(), not in printf().
So whatever the problem in the original posting, it's *not*
because of %f.

- Raw text -


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