Archive

Archive for October, 2009

Beyond my understanding!

October 30th, 2009 mahesh No comments

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: