*** empty log message ***

This commit is contained in:
hyung-hwan 2006-12-03 15:05:02 +00:00
parent aea12b37de
commit 1ba1a0bcd3
5 changed files with 40 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c,v 1.288 2006-11-29 02:54:16 bacon Exp $ * $Id: run.c,v 1.289 2006-12-03 15:05:01 bacon Exp $
*/ */
#include <ase/awk/awk_i.h> #include <ase/awk/awk_i.h>
@ -3794,7 +3794,17 @@ static ase_awk_val_t* __eval_binop_div (
if (n3 == 0) if (n3 == 0)
{ {
if (l2 == 0) PANIC (run, ASE_AWK_EDIVBYZERO); if (l2 == 0) PANIC (run, ASE_AWK_EDIVBYZERO);
res = ase_awk_makeintval (run, (ase_long_t)l1 / (ase_long_t)l2);
if (((ase_long_t)l1 % (ase_long_t)l2) == 0)
{
res = ase_awk_makeintval (
run, (ase_long_t)l1 / (ase_long_t)l2);
}
else
{
res = ase_awk_makerealval (
run, (ase_real_t)l1 / (ase_real_t)l2);
}
} }
else if (n3 == 1) else if (n3 == 1)
{ {

1
ase/test/awk/cou-001.awk Normal file
View File

@ -0,0 +1 @@
{ print $1, $3; } # print country name and population

15
ase/test/awk/cou-002.awk Normal file
View File

@ -0,0 +1,15 @@
BEGIN {
FS = "\t";
printf ("%10s %6s %5s %s\n\n",
"COUNTRY", "AREA", "POP", "CONTINENT");
}
{
printf ("%10s %6d %5d %s\n", $1, $2, $3, $4);
area = area + $2;
pop = pop + $3;
}
END {
printf ("\n%10s %6d %5d\n", "TOTAL", area, pop);
}

1
ase/test/awk/cou-003.awk Normal file
View File

@ -0,0 +1 @@
$3/$2 >= 0.5

11
ase/test/awk/cou-en.data Normal file
View File

@ -0,0 +1,11 @@
USSR 8649 275 Asia
Canada 3852 25 North America
China 3705 1032 Asia
USA 3615 237 North America
Brazil 3286 134 South America
India 1267 746 Asia
Mexico 762 78 North America
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe