some stuff

« Back to posts
  • Viewed
    times
October 31, 2009

Beyond my understanding!

  • Edit
  • Delete
  • Tags
  • Autopost
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?
  • 0 responses
  • Like
  • Comment