Posts for the month of January 2019

Oh god

lngnmn1@ideapad:~$ node
> "" == '0'
false
> 0 == ''
true
> 0 == '0'
true
> false == 'false'
false
> false == '0'
true

Wow

This is what we call inconsistent behavior. So much for the principle of less astounishment

lngnmn1@ideapad:~$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> round(1.5)
2
>>> round(2.5)
2
>>> round(3.5)
4 
>>> round(4.5)
4
>>> round(5.5)
6
>>> round(6.5)
6
>>>