Tuesday, September 18, 2012

Avoid integer division when programming

I didn't realize I was doing this but noticed I did have a problem for one of my Python scripts.  I was doing 1/2 which is apparently a no-no in programming.  I fixed it by doing 0.5*...  Other ways include 1.0/2 etc.

No comments:

Post a Comment