Difference between revisions of "Programming:Boolean Values"

From WhyAskWhy.org Wiki
Jump to: navigation, search
m (Removed duplicate title and added note)
m (Added entry for PowerShell)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Programming]]
 
[[Category:Programming]]
 
[[Category:DataType]]
 
[[Category:DataType]]
 +
[[Category:Tips]]
  
 
I sometimes mix up what language treats 0 as True or False, so this is a handy list to remind me.
 
I sometimes mix up what language treats 0 as True or False, so this is a handy list to remind me.
Line 18: Line 19:
 
|X
 
|X
 
|0
 
|0
 +
|-
 +
!PowerShell
 +
|X
 +
|0, <code>$false</code>, ""
 
|-
 
|-
 
!PHP
 
!PHP
Line 27: Line 32:
 
|0
 
|0
 
|-
 
|-
 +
!MySQL
 +
|X
 +
|0
 
|}
 
|}
 +
 +
== References ==
 +
 +
* http://stackoverflow.com/questions/289727/which-mysql-datatype-to-use-for-storing-boolean-values

Latest revision as of 22:20, 17 November 2015


I sometimes mix up what language treats 0 as True or False, so this is a handy list to remind me.

X = anything but zero

True False
Bash 0 X
C/C++ X 0
PowerShell X 0, $false, ""
PHP X 0
Python X 0
MySQL X 0

References