Boolean values: Difference between revisions

Content added Content deleted
No edit summary
m (→‎{{header|R}}: Text clarification)
Line 248: Line 248:


=={{header|R}}==
=={{header|R}}==
Similarly to Octave, R uses <tt>TRUE</tt> and <tt>FALSE</tt>, kept in variable of class logical, which is silently casted to 1 (TRUE) or 0 (FALSE) if used as numeric value. So, it is true even the opposite: the value 0 can be used as FALSE, and non-zero numbers as TRUE.
Similarly to Octave, R uses <tt>TRUE</tt> and <tt>FALSE</tt>, kept in variable of class logical, which is silently casted to 1 (TRUE) or 0 (FALSE) if used as numeric value. The opposite is also true: the value 0 can be used as FALSE, and non-zero numbers as TRUE.

The values T and F are given the values TRUE and FALSE respectively (for compatibility with S-Plus), though these may be changed to other values by the user.


=={{header|Ruby}}==
=={{header|Ruby}}==