News for hackers. Stuff that matters.
Re:What is the most intrusive wart on your favourite program... by ROFISH on Monday December 08, 2008 @11:42AM (#389998)
The C code for Fixnum#to_f is quite literally

  fix_to_f(VALUE num) {
    double val;
    val = (double)FIX2LONG(num); //RSHIFTs sign
    return DBL2NUM(val); //Ruby float constructor of C double value
  }
It does the same thing. Ruby, by design, flows left to right instead of nested params. This way you don't have float(user.timestamp) but instead user.timestamp.to_f.

There are no comments on this comment yet.