Ruby on Rails
Friday, December 7, 2012
On Fri, Dec 7, 2012 at 12:46 PM, Frederick Cheung <frederick.cheung@gmail.com> wrote:
On Thursday, December 6, 2012 8:41:20 AM UTC, Nicolas Desprès wrote:Hi,This is my first post on this mailing list and I would like to thanks the authors and the community for this great tools.After a couple of weeks happily playing with Rails, I got bitten by a strange behaviour drift between Rails and Ruby:Plain Ruby:$ irbirb(main):001:0> 2 / 5=> 2/5irb(main):003:0> 2.to_f / 5.to_f=> 0.4That's not how it behaves for me. I get 2 / 5 == 0 in both cases. The ruby mathn library (part of the stdlib) does do this (and I really wish it wouldn't). Perhaps something in your irbrc pulls this in ?
Not .irbrc. I forgot I had an alias on irb which pull -m option... :-( So the error was from my environment. Thanks for your reply.
Sorry for the noise.
Nicolas Desprès
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment