CS 1110 Lecture Notes - Lecture 1: Scientific Notation
Document Summary
Complex expressions --> an expression with four literals and some operators. Ex: (3*7+2)*9 would yield a different value than what we"ve entered as the input. Type = a set of values and operations on them. The meaning of these operations depends on the type. Int -- can be either positive or negative and will never have a decimal in them. float -- a number which includes a decimal. +, -, * (multiply), / (divide), ** (to the power of), unary - (making something a negative value). If i use only ints as inputs to an expression, i will always get an int in return. If an expression of ints would result in a decimal, the result would be rounded down to the nearest whole number. For instance 17 % 5 would yield 2. Floats can be expressed in scientific notation, decimals or exponential forms. Float answers may not always be reliable given base 2 inconsistencies.