Boolean values: Difference between revisions

m
→‎{{header|Phix}}: conversely not "=true"
(→‎{{header|Phix}}: added p2js note)
m (→‎{{header|Phix}}: conversely not "=true")
Line 1,969:
Zero is false, any other number is true. Attempting to use a string or sequence as a boolean is assumed to be a programming logic blunder and causes a fatal run-time error.
 
Conditions such as <code>if length(s) then</code> are permitted, but the more explicit <code>if length(s)!=0 then</code> is generally preferred., Comparisonand operatorsconversely, evaluate<code>if flag then</code> is to 1(true)be orpreferred 0(false).over <code>if flag=true then</code>.
Comparison operators evaluate to 1(true) or 0(false).
A boolean test is inverted by preceding it with the keyword <code>not</code>. The null character ('\0') is considered false, all other characters are deemed true.
The builtin constants TRUE/FALSE and their aliases True/true/False/false may also be used.
7,803

edits