CISC 101 Lecture Notes - Lecture 11: Exponentiation, Data Type, Operator Associativity
Document Summary
25 / 10 evaluates to 2. 5 (basically actually divide) Truncaing division is denoted by // providing a truncated result based on the type of operands applied to. 25 / 10 evaluates to 2 (basically remove the decimal) When both operands are integers => result is a truncated integer referred to as integer division. When one of the operands is a loat truncated loaing point. An expression is a combinaion of symbols that evaluates to a value. An expression can also consist of a single literal or variable. 4 + (3 * k) has two sub expressions: To write a comment, start the line with # . Well for operators following the associaive law doesn"t mater for addiion. Division and subtracion, do not follow the associaive law. Just go from lef to right just to be safe. Except for exponeniaion, that"s right to lef. A set of operators that may be applied to thosemater values.