some stuff

Archive for

October 2009

Mahesh Murthy

I am a Software Engineer working in Chicago for an amazing company called Signal. I love coding, out door sports and traveling. I blog here about random stuff once in a while.

Mahesh Murthy's profile »

Tags

  • UI (1)

Archive

2011 (12)
September (1)
August (4)
July (7)
2010 (6)
December (1)
November (1)
October (2)
June (1)
January (1)
2009 (17)
October (1)
September (1)
July (1)
April (3)
March (4)
February (1)
January (6)
2008 (18)
October (3)
September (1)
August (3)
July (3)
June (5)
April (1)
March (2)
Subscribe via RSS
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