103 lines
3.2 KiB
HTML
103 lines
3.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<title>TTCalc - comparative and logical operators and functions</title>
|
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
|
<param name="Keyword" value="<">
|
|
<param name="Keyword" value=">">
|
|
<param name="Keyword" value="<=">
|
|
<param name="Keyword" value=">=">
|
|
<param name="Keyword" value="==">
|
|
<param name="Keyword" value="!=">
|
|
<param name="Keyword" value="&&">
|
|
<param name="Keyword" value="||">
|
|
<param name="Keyword" value="if">
|
|
<param name="Keyword" value="and">
|
|
<param name="Keyword" value="or">
|
|
<param name="Keyword" value="not">
|
|
<param name="Keyword" value="logical operators">
|
|
<param name="Keyword" value="comparative operators">
|
|
<param name="Keyword" value="logical functions">
|
|
</object>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Comparative and logical operators and functions</h1>
|
|
|
|
<p>
|
|
We assume that the logical false is represented by zero and the logical true is represented by the
|
|
value different from zero. <strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.
|
|
</p>
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>x < y</dt>
|
|
<dd>This operator returns one if x is lower than y else it returns zero. For example:<br>
|
|
4 < 10 = 1<br>
|
|
6 < 2 = 0</dd>
|
|
|
|
<dt>x > y</dt>
|
|
<dd>This operator returns one if x is greater than y else it returns zero. For example:<br>
|
|
5 > 2 = 1<br>
|
|
5 > 8 = 0</dd>
|
|
|
|
<dt>x <= y</dt>
|
|
<dd>This operator returns one if x is lower than or equal to y else it returns zero. For example:<br>
|
|
4 <= 4 = 1<br>
|
|
7 <= 2 = 0</dd>
|
|
|
|
<dt>x >= y</dt>
|
|
<dd>This operator returns one if x is greater than or equal to y else it returns zero. For example:<br>
|
|
5 >= 5 = 1<br>
|
|
3 >= 4 = 0</dd>
|
|
|
|
<dt>x == y</dt>
|
|
<dd>This operator returns one if x is equal y else it returns zero. For example:<br>
|
|
4 == 4 = 1<br>
|
|
6 == 2 = 0</dd>
|
|
|
|
<dt>x != y</dt>
|
|
<dd>This operator returns one if x is different from y else it returns zero. For example:<br>
|
|
5 != 2 = 1<br>
|
|
5 != 5 = 0</dd>
|
|
|
|
<dt>x && y (logical and)</dt>
|
|
<dd>This operator returns one if both x and y are different from zero else it returns zero. For example:<br>
|
|
4 && 10 = 1<br>
|
|
6 && 0 = 0<br>
|
|
0 && 0 = 0</dd>
|
|
|
|
<dt>x || y (logical or)</dt>
|
|
<dd>This operator returns one either if x or y are different from zero else it returns zero. For example:<br>
|
|
5 || 2 = 1<br>
|
|
0 || 3 = 1<br>
|
|
0 || 0 = 0</dd>
|
|
|
|
<dt>if(condition; if_true; if_false)</dt>
|
|
<dd>If the 'condition' is true (different from zero) the function returns 'if_true' else it returns 'if_false', e.g.<br>
|
|
if( 0 ; 20 ; 30) = 30<br>
|
|
if( 1 ; 20 ; 30) = 20<br>
|
|
if( 4<5 ; 10 ; 50) = 10<br>
|
|
if( 6>10 ; 200 ; 100) = 100</dd>
|
|
|
|
<dt>and(x ; y)</dt>
|
|
<dd>This function does the same thing as the logical operator 'and' (&&)</dd>
|
|
|
|
<dt>or(x ; y)</dt>
|
|
<dd>This function does the same thing as the logical operator 'or' (||)</dd>
|
|
|
|
<dt>not(x)</dt>
|
|
<dd>If the x is true (different from zero) this function returns zero, otherwise it returns one, e.g.<br>
|
|
not(15)=0<br>
|
|
not(0)=1</dd>
|
|
|
|
</dl>
|
|
|
|
</body>
|
|
</html>
|
|
|