Boolean values: Difference between revisions

Content added Content deleted
(CoffeeScript)
Line 392: Line 392:
</lang>
</lang>


=={{header|Mathematica}}==
True and False are the default boolean values.
To make any expression a boolean use the Boole[] function.
=={{header|MATLAB}}==
=={{header|MATLAB}}==
The keywords "true" and "false" are the default boolean values. But, many functions prefer to return boolean "1" or "0" instead of "true" or "false". It is very important to note that having a function return a numerical 1 or 0 is not the same as a boolean "1" or "0". To make a number or array of numbers a boolean use the logical() function. logical() will convert any non-zero number to a boolean "1" and any zero entries a boolean "0".
The keywords "true" and "false" are the default boolean values. But, many functions prefer to return boolean "1" or "0" instead of "true" or "false". It is very important to note that having a function return a numerical 1 or 0 is not the same as a boolean "1" or "0". To make a number or array of numbers a boolean use the logical() function. logical() will convert any non-zero number to a boolean "1" and any zero entries a boolean "0".
Line 432: Line 436:


0</lang>
0</lang>



=={{header|Metafont}}==
=={{header|Metafont}}==