• Create BookmarkCreate Bookmark
• Create Note or TagCreate Note or Tag
• PrintPrint

### 5.6. The Comparison Operators

The comparison operators (also called relational operators) are used to determine which of two values appears first in a given order. Like the equality and inequality operators, the comparison operators return one of the Boolean values, true or false, indicating whether the relationship described in the comparison is accurate (true) or inaccurate (false).

Comparison operators are intended for comparing strings and numbers; when used with other types, automatic datatype conversion occurs, as discussed later in this chapter. When the two operands of a comparison operator are numbers, the comparison is performed mathematically: 5 < 10 is true, -3 < -6 is false, and so on. When the two operands of a comparison operator are strings, the comparison is performed according to character code points, as described in Chapter 4 under Section 4.6.2.2.

PREVIEW

Not a subscriber?

Start A Free Trial

• Create BookmarkCreate Bookmark
• Create Note or TagCreate Note or Tag
• PrintPrint