Clocks and elapsed time

  • I did that once. Created a fancy function to determine if a number was odd or even by comparing the results of (number/2) and (number/2.0). The first was integer division, where 5/2=2, and the second was floating-point division, where 5/2=2.5.


    I was really proud of it. Until someone pointed out, "why don't you just use a bitwise command and check if the lowest bit is true or false? You could do it in one line that way."


    I died a little....

Advertising from our partners