[Top][All Lists]
[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
ÿþS y s t e m I n f o r m a t i o n r e p o r t w r i t t e n a t :
1 0 . 0 7 . 2 0 0 2 1 2 : 4 8 : 4 5
[ S y s t e m S u m m a r y ]
I t e m V a l u e
O S N a m e M i c r o s o f t W i n d o w s 2 0 0 0
P r o f e s s i o n a l
V e r s i o n 5 . 0 . 2 1 9 5 S e r v i c e P a c k 2 B u i l d
2 1 9 5
O S M a n u f a c t u r e r M i c r o s o f t C o r p o r a t i o n
S y s t e m N a m e L E O
S y s t e m M a n u f a c t u r e r I B M
S y s t e m M o d e l 2 6 4 5 4 5 0
S y s t e m T y p e X 8 6 - b a s e d P C
P r o c e s s o r x 8 6 F a m i l y 6 M o d e l 5
S t e p p i n g 2 G e n u i n e I n t e l ~ 4 M h z
B I O S V e r s i o n 0 9 / 1 8 / 9 9
W i n d o w s D i r e c t o r y C : \ W I N N T
S y s t e m D i r e c t o r y C : \ W I N N T \ S y s t e m 3 2
B o o t D e v i c e
\ D e v i c e \ H a r d d i s k 0 \ P a r t i t i o n 1
L o c a l e U n i t e d S t a t e s
U s e r N a m e L E O \ A d m i n i s t r a t o r
T i m e Z o n e F L E D a y l i g h t T i m e
T o t a l P h y s i c a l M e m o r y 4 2 5 3 2 8 K B
A v a i l a b l e P h y s i c a l M e m o r y 1 7 5 5 1 6 K B
T o t a l V i r t u a l M e m o r y 1 2 3 3 6 2 0 K B
A v a i l a b l e V i r t u a l M e m o r y 7 6 6 3 0 8 K B
P a g e F i l e S p a c e 8 0 8 2 9 2 K B
P a g e F i l e C : \ p a g e f i l e . s y s
- GNU Awk 3.1.0 problem with float numbers with non-US locale,
Jouko Loikkanen <=