CIS 1057 Chapter 3: CIS 1057 Book Notes 6
Document Summary
Computes the integral part of the result of dividing the first operand by the second. Dividing by a negative integer has varying results by the compiler. Computes the integer remainder of the result of dividing the first operand by the second. Mod by a negative value varies by compiler. Data type of an expression depends on operands. If both values are integers, the data type of the expression is int. A data type with operands of different types is a mixed-type expression. Data type of a mixed-type expression is a double. When the expression being evaluated and the variable to which it is being assigned have different data types. When this occurs, the expression result is cast to the type of the variable. Programmers can change the type of a value via casts. Casts can be implicit (e. g. compiler casts) or explicit, when the programmer writes out (type)value to change the value to the type specified.