delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/22/19:26:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: Wed, 22 May 2002 19:25:00 -0400
From: Pavol Juhas <juhas AT seas DOT upenn DOT edu>
To: cygwin AT cygwin DOT com
Subject: bug in /usr/bin/printf "%4.0f\n" 0.1
Message-ID: <20020522192500.B2597@seas.upenn.edu>
Mail-Followup-To: cygwin AT cygwin DOT com
Mime-Version: 1.0
User-Agent: Mutt/1.2.5.1i

Hi,
I am using recent Cygwin on WindowsXP professional.
I have found this bug in when using /usr/bin/printf:
If printf "%4.0f" rounds its argument to 0, it only prints 3
characters instead of 4, e.g.:

$ printf "%4.0f\n%4.0f\n" 0 0.1
   0
  0

Can you also see this?
Originally, I have found this problem in gawk, but /usr/bin/printf behaves
in the same way.  I guess the problem is somewhere in the runtime libraries.

HTH,
        Pavol

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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