bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in printf


From: Frank Gunsing
Subject: bug in printf
Date: Wed, 25 Jul 2001 17:10:34 +0200
User-agent: Microsoft-Entourage/9.0.1.3108

In printf using %wf the number of digits goes beyond the width even
if not necessary.

The following

    printf "|%8f|\n", 1.0
    printf "|%8f|\n", 12.0
    printf "|%8f|\n", 123.0
    printf "|%8f|\n", 1234.0
    printf "|%8f|\n", 12345.0
    printf "|%8f|\n", 123456.0
    printf "|%8f|\n", 1234567.0
    printf "|%8f|\n", 12345678.0

gives as output

|1.000000|
|12.000000|
|123.000000|
|1234.000000|
|12345.000000|
|123456.000000|
|1234567.000000|
|12345678.000000|




   ==================================================================
     Frank Gunsing
   ------------------------------------------------------------------
     CEA/Saclay                       e-mail:      address@hidden
     DSM / DAPNIA / SPHN              phone:     + 33 1 69 08 75 23
     bat. 703 / Orme-des-Merisiers    fax:       + 33 1 69 08 75 84
     F - 91191 Gif-sur-Yvette
     France
   ==================================================================





reply via email to

[Prev in Thread] Current Thread [Next in Thread]