Hacker News new | past | comments | ask | show | jobs | submit login

Not trying to argue, just curious: what about Ruby you find surprising?



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


    >>> print(1.2 - 1.1)
    0.1




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: