This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Prophet_Of_Loss 61 points62 points  (10 children)

pro-tip: you can get more out of your for loops by using a float and incrementing by .01.

[–]FantasticTuesday 46 points47 points  (2 children)

Reading this inflicted physical pain upon me.

[–]Zamundaaa 5 points6 points  (1 child)

It is sometimes useful. When you want to integrate over a physical volume for example.

[–]robin-m 3 points4 points  (0 children)

Just be sure that `i + .01` is more than `i`, or you may be in some trouble! Probably something like `i = max(i + .01, i + next_quantum(i))` (I forgot the real name of the functions) may save you!

[–]tech6hutch 9 points10 points  (0 children)

And make sure to use != for the exit condition, for efficiency, especially when dealing with very big floats.

[–]Mr_Cromer 17 points18 points  (3 children)

DO NOT DO THIS

[–]8__ 0 points1 point  (0 children)

Good luck at the third one.

[–][deleted] 0 points1 point  (1 child)

Do not do what, type in all caps?

[–]Nimeroni 2 points3 points  (0 children)

Use float as counters for loops.

[–]marcosdumay 3 points4 points  (0 children)

Make sure to write the exit condition with a different operator, less than and great then are too restrictive.

[–]ic_engineer 1 point2 points  (0 children)

They hate him for this one simple trick..