|Dec 17, 2012, 11:23 AM||#1|
Very odd error in looping - possible bug in AWK maths library?
I use AWK (C-like programming language used to parse tables - and, yes, I know that's primitive of me). Check out the following behaviour
for (x=0.01;x<=0.05;x+=0.01) Stops at 0.05 as expected
for (x=0.01;x<=0.06;x+=0.01) Stops at 0.05
for (x=0.01;x<=0.06000001;x+=0.01) Stops at 0.06 as expected
for (x=0.1;x<=0.6;x+=0.1) Stops at 0.6, as expected
for (x=0.01;x<=0.10;x+=0.01) Stops at 0.10 as expected and steps through 0.06 just fine
Possible maths library bug? Anybody else able to confirm this perhaps with C (I am not sure, but I presume AWK uses C's maths libraries)?
Mac OS X 10.8.2
iMac 27" i7
My first was a Mac+. Now I own an iPhone with 3.5x the pixels, a colour display, WiFi, 512x the RAM, >1500x the data storage, and 100x the speed. And it fits in the palm of my hand.
Last edited by VulchR; Dec 17, 2012 at 11:39 AM.
|awk, bug, looping|
|Thread Tools||Search this Thread|
All times are GMT -5. The time now is 03:55 AM.