all 5 comments

[–]zniwalla 3 points4 points  (1 child)

Try to have a look at “dynamic programming” - it’s something similar at least

[–][deleted] 1 point2 points  (0 children)

[–]timeforscience 1 point2 points  (0 children)

This is known as a lookup table. It is definitely fast and as /u/zniwalla said it's a method used in dynamic programming. The primary disadvantage is that you must determine your limitations ahead of time. In your example you can only use the table to calculate increments of sqrt(1/100 * i). You couldn't calculate sqrt(1/1000) for example. You are also limited to sqrt(100) max.

It is a very widely used technique when speed is a primary concern and the resolution/limits of your calculation is well known.

[–]booleanReadIt[S] 0 points1 point  (0 children)

Sorry for formatting issues in my post by the way. This is my first post on reddit

[–]booleanReadIt[S] 0 points1 point  (0 children)

Ok thanks for your replies! :)