103 ms·
Not trying to argue, just curious: what about Ruby you find surprising?
by jablan 15y ago
Not trying to argue, just curious: what about Ruby you find surprising?
- nyellin 15y agoOff 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
- ddagradi 15y agoFloats 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.
- nyellin 15y agoI could have sworn I tried that a week ago and it didn't work. Thanks for the correction.
- getsat 15y agobash-3.2$ python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) >>> 1.2 - 1.1 0.09999999999999987
- _genova 15y ago>>> print(1.2 - 1.1) 0.1