CS 151 Lecture 11: Sections 5.3-5.4

87 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents