Re:Kidsruby - Learn Ruby for kids
by jablan on Monday December 26, 2011 @03:11PM
(#3393809)
Not trying to argue, just curious: what about Ruby you find surprising?
[ Parent
| on HN ]
Off the top of my head (there is more):
* Floats are printed without rounding
* You can write x = foo unless foo but not x = foo if ! foo
Floats are printed without rounding
Isn't that a good thing? I like knowing the real value I'm passing around. It does round...eventually (at 14 decimal places or so).
You can write x = foo unless foo but not x = foo if ! foo
This is incorrect.
I could have sworn I tried that a week ago and it didn't work. Thanks for the correction.
bash-3.2$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
>>> 1.2 - 1.1
0.09999999999999987