Home > Uncategorized > Beyond my understanding!

Beyond my understanding!

I had a bug in my application where the calculation was a little off from expected. After putting debug statements, I narrowed it down to an interesting behaviour in ruby. Fire up irb and try it out yourself!

irb(main):001:0> (6.725*60*24).to_i
=> 9684
irb(main):002:0> (6.725*24*60).to_i
=> 9683

wtf?

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Anti-Spam Protection by WP-SpamFree