0

false is boolean, isn't it?

4th Jul 2017, 8:06 AM
Som Konk
7 Respuestas
+ 3
Yes, it is... ^_^
4th Jul 2017, 8:31 AM
Ekansh
+ 3
All language 0 is as 'false'/'null' Think about binary is enough...
4th Jul 2017, 1:19 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
:/ Hm.... It Look like ruby give a big problem to me a lot
6th Jul 2017, 1:28 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 2
A boolean variable is a variable wich can have two values : true or false. False == 0 True == every number but not 0 true && false == false true || false == true Ask if you have any question.
4th Jul 2017, 8:10 AM
Jojo
+ 2
Be aware ! 0 is NOT false in ruby (unlike every other programming language) only false and nil evaluates as false. https://repl.it/JPxw/0
6th Jul 2017, 9:22 AM
Salekin
Salekin - avatar
0
Why then ruby evaluates it to falsey?
4th Jul 2017, 8:47 AM
Som Konk
0
true
19th Jul 2017, 1:14 AM
Jim Tully
Jim Tully - avatar