4.3 Data Representation Flashcards
Absoolute and Relative Error
Absolute Error - True Value - Appromixmate Value
Relative Error - Absolute Error / True Value
For example, represent 19.3 as most accurate as possible in floating point in which you get 19.25, therefore Absolute Error = 19.3 - 19.25 = 0.05 so Relative Error = 0.05 / 19.3 = 0.26%
Truncation
Method used when there are not enough bits to represent the full number, and so the extra bits are simply left out at the end.
For instance 0.0101101 would be stored in 4 bits as 0.010
Rounding
More accurate than truncation, if the bit after the last bit to be represented as 1, the previous bit would be increased to 1
For instance, 0.0101101 (0.3515625) would be stored as 0.011 (0.375), The rouding error would be 0.0000011 (0.0234375) which is found by the absolute error formula, 0.375 - 0.3515625 = 0.0234375