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

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

GNU Awk 3.1.0 problem with float numbers with non-US locale


From: Jouko Loikkanen
Subject: GNU Awk 3.1.0 problem with float numbers with non-US locale
Date: Wed, 10 Jul 2002 13:11:37 +0300

Hi 

Is that known problem or a bug? It works OK with older awk but not
the newest if locale (Start->Setting->Control Panel->Regional Options->
Location) is e.g. finnish?

Thanks,

Jouko

Problem with newest version
===========================

E:\home\grinder\test\log>awk --version
GNU Awk 3.1.0
Copyright (C) 1989, 1991-2001 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

E:\home\grinder\test\log>type float.awk
BEGIN {
        fBase=10.0
        printf("Base number to sum XX (float) is: %f (float)\n\n", fBase)
        printf("Enter a number for XX: ");
}
{
        if ($1 == "q")
                exit 0
        fTotal=($1+0.0) + fBase
        printf("%f + %f = %f\n\n", fBase, $1, fTotal)
        printf("Enter a number for XX (or q to quit): ");
}


E:\home\grinder\test\log>awk -f float.awk
Base number to sum XX (float) is: 10,000000 (float)

Enter a number for XX: 1
10,000000 + 1,000000 = 11,000000

Enter a number for XX (or q to quit): 1.1
10,000000 + 1,000000 = 11,000000

Enter a number for XX (or q to quit): 1,1
10,000000 + 1,100000 = 11,100000

Enter a number for XX (or q to quit): 0.1
10,000000 + 0,000000 = 10,000000

Enter a number for XX (or q to quit): 0,1
10,000000 + 0,000000 = 10,000000

Enter a number for XX (or q to quit): q


OK with older version
=====================

E:\home\grinder\test\log>awk2 --version
Gnu Awk (gawk) 2.15, patchlevel 6

E:\home\grinder\test\log>awk2 -f float.awk
Base number to sum XX (float) is: 10.000000 (float)

Enter a number for XX: 1
10.000000 + 1.000000 = 11.000000

Enter a number for XX (or q to quit): 1.1
10.000000 + 1.100000 = 11.100000

Enter a number for XX (or q to quit): 1,1
10.000000 + 1.000000 = 11.000000

Enter a number for XX (or q to quit): 0.1
10.000000 + 0.100000 = 10.100000

Enter a number for XX (or q to quit): 0,1
10.000000 + 0.000000 = 10.000000

Enter a number for XX (or q to quit): q

E:\home\grinder\test\log>

-- 

Jouko Loikkanen
BEA Systems Oy       mailto:address@hidden
Westendintie 1 B     Mobile: +358-40-546 5380
FIN-02160 Espoo      Phone:  +358-9-5024 4478 
FINLAND              Fax:    +358-9-5024 4430
http://www.beasys.fi http://www.beasys.com
ÿþSystem Information report written at: 
10.07.2002 12:48:45

[System Summary]



Item       Value

OS Name Microsoft Windows 2000 
Professional

Version 5.0.2195 Service Pack 2 Build 
2195

OS Manufacturer Microsoft Corporation

System Name LEO

System Manufacturer IBM

System Model       2645450

System Type X86-based PC

Processor     x86 Family 6 Model 5 
Stepping 2 GenuineIntel ~4 Mhz

BIOS Version       09/18/99

Windows Directory     C:\WINNT

System Directory       C:\WINNT\System32

Boot Device 
\Device\Harddisk0\Partition1

Locale   United States

User Name     LEO\Administrator

Time Zone     FLE Daylight Time

Total Physical Memory     425 328 KB

Available Physical Memory     175 516 KB

Total Virtual Memory       1 233 620 KB

Available Virtual Memory       766 308 KB

Page File Space 808 292 KB

Page File     C:\pagefile.sys




reply via email to

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