[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
int-function: programming error or bug?
From: |
Aron Brunner |
Subject: |
int-function: programming error or bug? |
Date: |
Fri, 27 Feb 2009 15:14:38 +0100 |
User-agent: |
CAMAS/1.2.21-RC4 (CAudium Mail Access System) |
Dear Sir, dear Madame,
thank you very much for awk/gawk i work with over the last 10 years
with success and great joy.
With gawk 3.1.6 on Mandriva 2009.0 i get a result i don't understand:
The code
-----------------------------------------------
#!/usr/bin/awk -f
BEGIN {
for (alfa=8.6;alfa<=9.2;alfa=alfa+0.1) {
alfaint=int(alfa);
printf "%s%5.10f s%d\n","alfa=",alfa,"int(alfa)=",alfaint;
}
beta=9.0;
betaint=int(beta);
printf "%s%5.10f %s%d\n","beta=",beta,"int(beta)=",betaint;
}
-----------------------------------------------
gives the integer from alfa=9.0 to 8:
alfa=8.6000000000 int(alfa)=8
alfa=8.7000000000 int(alfa)=8
alfa=8.8000000000 int(alfa)=8
alfa=8.9000000000 int(alfa)=8
alfa=9.0000000000 int(alfa)=8
alfa=9.1000000000 int(alfa)=9
alfa=9.2000000000 int(alfa)=9
beta=9.0000000000 int(beta)=9
I suppose i wrote the code-lines in a wrong manner;
may i respectfully ask for information.
Yours sincerely
Aron
----------------
Aron Brunner
Via Castagni, 13
39012 Merano (Bolzano) Italy
address@hidden
- int-function: programming error or bug?,
Aron Brunner <=