Difference between revisions of "Greater-than-or-equal"
m (removed irrelevant keywords, replaced angle bracket with HTML entity)
m (1 revision)
|(2 intermediate revisions by the same user not shown)|
Latest revision as of 19:12, 8 March 2015
Greater-than-or-equal, >=, is an inequality operator to test whether the value on the left is greater than, or equal to, the value on the right.
|Availability||Present in all original versions of BBC BASIC.|
|Syntax||BASIC I-V|| <num-var> = <numeric> |
<num-var> = <string>
|Token (hex)||BASIC I-V|| |
|Description||BASIC I-V|| Compares the values of the two operands and returns |
|Associated keywords|| |
>= evaluates the expressions on either side, and compares their values. If the values are equal, or if the value on the left is greater than the one on the right, it returns the Boolean value
TRUE, otherwise it returns
FALSE. It is usually used as the condition of an
IF statement, but it is equally valid to assign the result to a variable.
The symbol is an ASCII substitute for ≥. The
> comes first so that the
= is not misinterpreted as an assignment statement (see
One numeric variable is greater than another if it is nearer to positive infinity. If both numbers are negative, the one with the smaller magnitude is greater. For the definition of 'greater-than' on strings, please see String collation.
It is not possible to daisy-chain (in)equality tests (for example
IF bool% >= X = Y THEN ...), as the Group 5 operators do not associate. Please see
= for more details.
Due to the numerical values of
FALSE in BBC BASIC,
>= serves as a Boolean operator of material implication whose logical symbol is → :
|A||B|| A |
-- beardo 23:24, 13 June 2007 (BST)