delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/30/08:15:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 30 Jun 2005 14:12:36 +0200 (CEST)
Message-ID: <6879888.1120133556579.JavaMail.adm-moff@moffice2.nsc.no>
From: "Peter J. Acklam" <pjacklam AT online DOT no>
To: <cygwin AT cygwin DOT com>
Subject: SV: SV: Bug in printf ?
Cc: <pjacklam AT online DOT no>
In-Reply-To: <SERRANOPL83mxMAKytt000002d1@SERRANO.CAM.ARTIMI.COM>
Mime-Version: 1.0
References: <20050630 DOT 202057 DOT 83613389 DOT haro AT kgt DOT co DOT jp> <SERRANOPL83mxMAKytt000002d1 AT SERRANO DOT CAM DOT ARTIMI DOT COM>
X-IsSubscribed: yes

------=_Part_8541_19733378.1120133556574
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Dave Korn [dave DOT korn AT artimi DOT com] wrote:

> haro AT kgt DOT co DOT jp wrote:
>
> > How come "0.125" gets printed as "0.12", and not "1.3"?
> 
> Absolutely, there's a rounding error of some sort.

For what it's worth: My Sunblade 100 running Solaris 9 has
Solaris' /bin/printf and GNU's printf as /usr/local/bin/printf
and both give "0.12", not "0.13".

I am quite sure it is the printf returning "0.13" that is buggy.
Note that the value "0.125" can be represented exactly with IEEE
double precision arithmetic, so inexact representation is not the
matter here.

Peter


------=_Part_8541_19733378.1120133556574
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_Part_8541_19733378.1120133556574--

- Raw text -


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