The method of getting machine number iscalled rounding method;The other method of getting machine number iscalled truncation method.The correspondingmachine numberis:fl(x) = sgn(x)0.b,b, ...b, ×2m
1 2 ( ) sgn( )0. 2m t fl x x b b b = The method of getting machine number is called rounding method; The other method of getting machine number is called truncation method . The corresponding machine number is:
Be similar tothe binary machine number system, thedecimal machine number system is F(1,t, L,U),it hastwo methods to get the machinenumber.rounding method: According to the principle of four tofivehomes to intercept the t bits mantissatruncation method: Intercepting the t bits mantissaas the machine number mantissaExample4.Please real numberexpressesas themachine number in F(10,t,L,U) .Solution fl(元) = 0.31416×10(rounding method)fl(元)=0.31415×10(truncation method)
Be similar to the binary machine number system, the decimal machine number system is ,it has two methods to get the machine number. F(10,t, L,U) rounding method: According to the principle of four to five homes to intercept the t bits mantissa truncation method: Intercepting the t bits mantissa as the machine number mantissa Example 4. Please real number πexpresses as the machine number in F(10,t, L,U) . Solution fl( ) 0.31416 10 = fl( ) 0.31415 10 = (rounding method) (truncation method)
The following discussion computer floating-point arithmeticA computer can only do add, subtract, multiply and dividefourarithmetic operations,but the machine number to four operations are not closed.that is to say any two different numbers in F adding,subtracting, multiplying and dividing is not always in Fat this time, the computer will use F machine number torepresent automaticallycalculated results
The following discussion computer floating-point arithmetic. A computer can only do add, subtract, multiply and divide four arithmetic operations, but the machine number to four operations are not closed, that is to say any two different numbers in F adding , subtracting, multiplying and dividing is not always in F. at this time, the computer will use F machine number to represent automatically calculated results
Ifxandyaremachine numbers,x,yE F(10,t, L,U)The arithmetic operations comply with the following rules:(1) addition and subtraction methods : First order (by highorder), after the operation, and then rounding(2)multiplication and division methods: First the operation.andthenrounding
The arithmetic operations comply with the following rules: x y F t L U , (10, , , ) (1) addition and subtraction methods : First order (by high order), after the operation, and then rounding (2)multiplication and division methods : First the operation, and then rounding. If x and y are machine numbers
s3 The error of numericalcalculation1)Source and classification of error>Abstracting a math modelfrom the practical problems-errorofmodel>Getting the parameter value ofthe model by measuring-observationerror>Getting the approximate solutionerror ofmethod (truncationerror)>The length of machinenumberis limitedroundingerror
§3 The error of numerical calculation 1) Source and classification of error ➢Abstracting a math model from the practical problems —— error of model ➢Getting the parameter value of the model by measuring —— observation error ➢ Getting the approximate solution —— error of method (truncation error) ➢ The length of machine number is limited —— rounding error