Lessons in exponential growth: Im testing a computer program - TopicsExpress



          

Lessons in exponential growth: Im testing a computer program that finds the value of pi. Original, right? The problem is that I need to run huge numbers of tests on randomly generated values to reduce the margin of error. And when I say huge, I mean a million is basically a starting point. However, the program as written uses integer types to track the data. Integers only have a scope between negative and positive ~2.1 billion. But even then, its not accurate enough. Worse, the calculations are starting to take measurable amounts of time. A million calculations happens before I can blink, but a billion took almost 30 seconds to complete. Feeling cheeky, however, I modified the program to loop through the number of tests a number of times equal to the number of tests; squared, in other words. And without thinking, I happily typed in a million, which will result in a trillion iterations - should be pretty accurate, right? Well, Ill let you know in 8 hours when the calculations finish. Because Im a dumb who doesnt understand exponential growth.
Posted on: Thu, 17 Apr 2014 19:45:07 +0000

Trending Topics



Recently Viewed Topics




© 2015