ECS 30 Lecture Notes - Operand, Odometer

12 views1 pages

Document Summary

Adding one to the number of an of a char type will cause it to go to the next letter up. Something like -16/3 or -16%3 could be dangerous. Dividing or modulus by zero will lead to an application crashing. If the operands are floating point numbers and one is an int, it will become a float, as the solution itself. If the operand is smaller than int, it will automatically become an unsigned or signed int. If a type is too small, you will lose a piece of information when converting. Placing the type declaration before a number gives a way to alter an expression. (int)3. 3 becomes 3. Overflow is when a type is too small to hold values, so it overflows. Unsigned types and signed types wrap around like an odometer. Data that can"t be represented by floats should be thought of as infinity.

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