4.5) Comparisons
==
tests for equality (note the two equals symbols);!=
tests for inequality<
,<=
,>
,>=
behave as they do in other programming languages- All of these operators return a
bool
value (true
orfalse
) - Comparisons aren't often used on their own; normally they feature in conditional statements (discussed later)
- Testing floating-point values for equality is not trivial and requires great care, as in most other languages