Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Dec 17, 2012, 12:23 PM   #1
VulchR
macrumors 68000
 
VulchR's Avatar
 
Join Date: Jun 2009
Location: Scotland
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 12:39 PM.
VulchR is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
awk, bug, looping

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Odd Safari bug when printing to PDF chriscl OS X Mavericks (10.9) 2 Oct 12, 2013 02:21 PM
Odd iMessage Bug Truncates Last Word of Certain Text Phrases MacRumors MacRumors.com News Discussion 105 Sep 16, 2013 09:48 PM
Odd Finder bug Soundflunky OS X Mavericks (10.9) 4 Aug 11, 2013 11:23 PM
Odd Mountain Lion Crashing Bug Brings Down Nearly Any App MacRumors MacRumors.com News Discussion 188 Apr 15, 2013 03:50 AM

Forum Jump

All times are GMT -5. The time now is 07:17 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC