Robert113355
February 21st, 2002, 01:36 PM
Anyone know of any decent books that show simplified mathmatical formulas implemented in code? (I saw an extremely old one that a professor had called "Math Recipes")
For an example there was an question of adding all numbers between 1-n including n. Now I would have done a nice for() loop but there was a much simpler formula in this book for example:
Answer = (n + (n*(n-1))/2); // Bam!
return Answer;
For an example there was an question of adding all numbers between 1-n including n. Now I would have done a nice for() loop but there was a much simpler formula in this book for example:
Answer = (n + (n*(n-1))/2); // Bam!
return Answer;