www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/27/10:27:05

Date: Mon, 27 Jan 1997 17:11:41 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: jz AT bcsupernet DOT com
cc: djgpp AT delorie DOT com
Subject: re:printf("%.6f")
In-Reply-To: <5cgfka$pp0@clark.zippo.com>
Message-ID: <Pine.SUN.3.91.970127165906.9059C-100000@is>
MIME-Version: 1.0

On 26 Jan 1997 jz AT bcsupernet DOT com wrote:

> Each iteration of the loop is taking about a half a second.  the entire 
> program takes just under 6 minutes to run which is just silly. The same 
> program with the %.6f's taken out takes 10 seconds.

I don't find this neither surprising nor silly.  When you use a float 
format, `fprintf' has a lot of FP computations to do, and they all are 
emulated when you don't have a co-processor.  The usual ratio of run 
times between a machine with FPU and one without it, when they run an FP 
program, is about 20-30.  You see 6min / 10sec = 36, which is only 
slightly higher (probably, due to the fact that you eliminate the %f 
processing altogether rather than doing it with an FPU).

So I would say this is expected behavior.

- Raw text -


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