Boolean values: Difference between revisions

Content added Content deleted
m (→‎{{header|Octave}}: added 0 and not-0 as usable for false and true)
Line 117: Line 117:


=={{header|Octave}}==
=={{header|Octave}}==
Octave uses <tt>true</tt> (1) and <tt>false</tt> (0). The class of a variable holding a boolean value is ''logical'', which however can be casted to a numeric class, so that <code>r = true; r * 2</code> gives 2 as result.
Octave uses <tt>true</tt> (1) and <tt>false</tt> (0). The class of a variable holding a boolean value is ''logical'', which however can be casted to a numeric class, so that <code>r = true; r * 2</code> gives 2 as result. Any non-zero value is interpreted as true, and 0 as false.


=={{header|Perl}}==
=={{header|Perl}}==