ENGR 101 Lecture Notes - Lecture 17: Nibble, Operand
Document Summary
Engr 101: introduction to computers and algorithms - lecture 17: data representation and binary math. If you want a variable to never change in the context of the code you can define it to be a const. Does not replace the type, but rather modifies the data type. You can make identifiers have global scope. This is risky for non-constant identifiers, since they can change function without explicitly being passed in. Coercion: the implicit (automatic) conversion of a value from one data type to another. May apply when: evaluating a mixed-type expression. More restricted operand is promoted to type of other. Passing a value to a function/ returning a value from a function. Casting: the explicit conversion of a value from one data type to another. Explicit cast often recommended for clarity, even when coercion would apply. All data inside the computer is represented by bits. Bits can have only two values 0 or 1.