CS 151 Lecture 11: Sections 5.3-5.4
Document Summary
Two floating point values are equal, according to the == operator, only if all the binary digits of their underlying representations match. You should rarely use the equality operator (==) when comparing floating point values. A better way to check for floating point equality is to compute the absolute value of the difference between the two values and compare the result to some tolerance level. The relative order of characters in java is defined by the unicode character set. We can use the equality and relational operators on character data. The unicode character set is structured so that all lowercase alphabetic characters ("a" through "z") are contiguous and in alphabetical order. The same is true of uppercase alphabetic characters ("a" through "z") and characters that represent digits ("0" through "9"). The digits precede the uppercase alphabetic characters, which precede the lowercase alphabetic characters. Before, after, and in between these groups are other characters.