Error
measured value: , exact value:
Error’s operation
For Eq.1.1, when two approximate value subtracted, its relative error will be increased.
For Eq.1.3, when the value is divided by decimals, its absolute error will be increased.
Significant digits
- Definition: 当 的绝对误差限为某一位的半个单位,则这一位到第一个非零位的位数称为 的有效位数。
Binary numbers
Decimal to binary
- Integer part:
- dividing by 2 successively and recording the remainders.
therefore,
- Fractional part
- Multiply by 2 successively and record the intger parts.
Therefore,
Floating point for real numbers
precision | sign | exponent | mantissa |
---|---|---|---|
single | 1 | 8 | 23 |
double | 1 | 11 | 52 |
long double | 1 | 15 | 64 |
the form of a normalized IEEE floating point number :

double precision number of 1
- Machine epsilon: is the distance between 1 and the smallest floating point number greater than 1. .
- Truncate number method:
- Chopping
- if the 53nd bit is 0, than truncate the number at 53nd bit.
- rounding
- add 1 to bit 52 if bit 53 is 1, and add nothing to bit 52 if bit 53 is 0.
- Rounding to Nearest Rule
- the 53 bit is 1, and is followed by other nonzero bits. either round up or round down to make 52 bit equal to 0.
- Chopping
- Bit 1 : sign number
- 0: +
- 1: -
- Bit 2: exponent sign number
- 1: the exponent number is greater than 1
- 0: the exponent number is less than 1
HW: 数值分析-第一次作业-误差与计数