News for hackers. Stuff that matters.
Re:What is the most intrusive wart on your favourite program... by cabalamat on Monday December 08, 2008 @07:38AM (#389786)
> Ruby's int.to_f seems much nicer than a built-in function float(int)

I multiply by 1.0 to turn an int into a float:

   Python 2.5.1 (r251:54863, Jul 31 2008, 23:17:40)
   >>> 3/2
   1
   >>> 3*1.0/2
   1.5
   >>> float(3)/2
   1.5

There are no comments on this comment yet.