Software designer _ examples

● When scientific computing with computers, often encounter "overflow", which refers to __ () __.
A. The amount of data exceeds the memory capacity B. Value exceeds the range of the specified data type representation
C. Type of data out of the specified range D. Numerical format does not meet the requirements for a computer
answers to questions: B

binary fraction method of seeking 0.125

--0 2 * 0.125 = 0.25 
    0.25 2 = 0.5 --0 * 
    0.5 * 2 = 1--1 
    end
     0.125 to binary 0.001 i.e. 1 * E-3

binary fraction method of seeking 0.6

 

0.6 * 2 = 1.2 --1 (remainder 0.2) 
0.2 * 2 = 0.4 --0 (remainder 0.4) 
0.4 * 2 = 0.8 --0 (remainder 0.8) 
0.8 * 2 = 1.6 --1 (remainder 0.6) 
0.6 * --1 2 = 1.2 (0.2 remainder) 
... 
enter an infinite loop 0.6 of 0. the binary decimal 1001 100 110 011 ...

 

Guess you like

Origin www.cnblogs.com/coloz/p/11261920.html