Doesn't this give the same value as a.to_i? I think it might also give the wrong value for INT(-8.9)? I think that a.floor might be the closest matching ruby function.