[̲] [] []

 

5. Ҳ

5.1.

5.2.

5.2.1.

5.2.2. ֳ

5.2.3. ij

5.2.4.

5.3.

5.3.1.

5.3.2. ֳ

5.3.3. ij

5.4.

5.5.

5.6. ,

5.7. ,

5.7.1.

5.7.2.

5.8.

5.9.

 

5. Ҳ

 

, , . ³ , .

.

, : , , , . , , , () .

, , : - - .

. .

, , , - .

 

5.1.

 

, , ' . , - , , . . , , . , , - . , . - , , , , . , , : . , .

. , .

, , b , , b- . , p 8 p10 = 3.141592710, 8 - p8 = 3.11037558.

5.1. , 10, , (, 63.48 63.4810 ). , , . - , .

- , , p 10

 

0 -1 -2 -3 -4 -5 -6 -7

3.141592710= 3*10 +1*10 +4*10 +1*10 +5*10 +9*10 +2*10 +7*10

 

8

0 -1 -2 -3 -4 -5 -6 -7

3.11037558 = 3*8 +1*8 +1*8 +0*8 +3*8 +7*8 +5*8 +5*8.

 

b>1.

b

 

(... a .a ...) =

3 2 1 0 -1 -2 -3 b

 

3 2 -1 -2 -3

=...+ *b + *b + *b + + *b + *b + *b +...,

3 2 1 0 -1 -2 -3

 

k b 0,1,..., b-1.

8

 

(462.7)8 = 4*64 + 6*8 + 2 + 7*(1/8) = (306.875)10.

 

div mod, , , . Trans(a, b1, b2) - , b1 b2.

 

.

( > 1) b- round(, , b),

 

round(0, , b) = 0;

r-p p-r

round(, , b) = sign()*b *[b * + 1/2],

 

r-1 r

b <=< b. 1/2 Trans(0.5,10, b).

 

, =(11.011) = (3.375), b=2 =3.

2 10

1 2

(2 ) = (10) (2 ) = (100), , r=2.

10 2 10 2

2-3 3-2

round(,3,2) = sign()*2 *[2 *11.011+ 1/2] =

 

-1 -1

= 2 *[2*11.011+0.1] = 2 *[110.11+0.1] =

 

-1 -1

= 2 *[111.01] = 2 *(111) = (11.1) = (3.5).

2 2 10

(3.375)10 , ,

 

-2 2 -2

round(, 3,10) = 10 *[10 *3.375+1/2] = 10 *[337.5+0.5] =

 

-2

= 10 *(338) = (3.38).

10 10

(3.38)10 (11.0110001)2.

 

³ .

5.1.

round(1, , b) = 1.

.

1- -1 1-p -1

round(1, , b) = b *[b + 1/2] = b *b = 1,

 

-1 -1 -1

> 1 b > 1 [b + 1/2] = b.

 

5.2.

round(- , , b) = - round(, , b).

sign(- ) = - sign().

 

5.3.

round(b*, , b) = b*round(, , b).

 

r-1 r

. b << b , b*

 

r r+1

b <b*< b ,

r+1-p p-r-1

round(b*, , b) = sign(b*)*b *[b *b* + 1/2] =

 

r-p p-r -1

= b*sign()*b *[b *b *b* + 1/2] =

 

= b*round(, , b).

 

.

³ >0

 

r-1 r-2 r-p r-p-1

= *b + *b +...+ *b + *b +...,

1 2 +1

r-1 r-2 r-p

round(, , b) = *b + *b +...+ c *b ,

1 2

_ r-p

, 0 <= z < 1/2*b ,

c = < r-p r-p

+1, 1/2*b <= z < b ,

_

 

r-p-1 r-p-2

z = *b + *b +...

+1 +2

 

r-p r-p

x-round(, , b) = *b - c *b + z =

_ _

z , c =

r-p

= < r-p > <= 1/2*b .

z - b , c = +1

_ _

 

=x-round(, , b) .

r-p

<= 1/2 * b .

 

, , x. , , .

d ,

1-

round(, , b)- = d**b ,

1- r-p

d**b < 1/2*b.

r-1 r

b << b ,

 

r-p-1+ r-1 r-1

d <= 1/2*b / <= 1/2*b /b = 1/2.

 

1-

dp () = d*b .

,

 

5.1. ³ , round(, , b) = *(1+dp()),

 

1-

dp() < 1/2 * b .

 

- ,

 

u + v = round(u+v, , b); u - v = round(u-v, , b);

 

u * v = round(u*v, , b); u / v = round(u/v, , b).

 

, - () . ,

 

5.2.

a) u + v = v + u, u * v = v * u;

 

b) u - v = u + -v;

 

c) -(u + v) = - u + -v, -(u * v) = (- u) * v;

 

d) u + v = 0 <=> u = -v;

 

e) u * v = 0 <=> u=0 V v=0;

 

f) (- u) / v = u / (- v) = -(u / v);

 

h) u / u = 1,

<=> " , ".

- , .

 

5.1. ³

 

u + v = (u+v)*(1+dp(u+v)); u - v = (u-v)*(1+dp(u-v));

 

u * v = (u*v)*(1+dp(u*v)); u / v = (u/v)*(1+dp(u/v)),

 

1-

1/2*b .

 

5.2. , , . ij

 

(11111113. +8 -11111111.) +8 7.5111111 =

 

= 2.0000000 +8 7.5111111 = 9.5111111;

 

11111113. +8 (-11111111. +8 7.5111111) =

 

= 11111113. +8 -11111103. = 10.000000.

 

,

 

(20000.000 *8 -6.0000000) +8 (20000.000 *8 6.0000003) =

 

= -120000.00 +8 120000.01 = 0.01000000;

 

20000.000 *8 (-6.0000000 +8 6.0000003) =

 

= 20000.000 *8 0.00000030 = 0.00600000.

 

. 5.1

 

(u * v) * w = ((u*v)*(1+d )) * w = u*v*w*(1+d )*(1+d );

1 1 2

 

u * (v * w) = u * ((v*w)*(1+d )) = u*v*w*(1+d )*(1+d ),

3 3 4

 

 

1-

d < 1/2*b , k=1,2,3,4.

k

 

(u * v) * w (1+d )*(1+d )

1 2

------------- = ------------- = 1+d,

u * (v * w) (1+d )*(1+d )

3 4

 

(1+d )*(1+d ) - (1+d )*(1+d )

1 2 3 4

d = ----------------------------- <

(1+d )*(1+d )

3 4

 

1- 2 1-p 2 1-p

(1+1/2*b ) - (1-1/2*b ) 2*b

< ----------------------------- = -------------.

1- 2 1-p 2

(1-1/2*b ) (1-1/2*b )

 

,

5.3. ³ d

 

(u * v) * w = u * (v * w)*(1+d)

 

 

1-

2*b

d < -------------.

1- 2

(1-1/2*b )

 

.

 

5.1. 2-400*+1=0, - .

.

___________________ ________

= 200.000 + Ö 40000.0 - 1.00000 = 200.000 + Ö 39999.0 =

1 6 6 6

= 200.000 + 199.997 = 399.997;

6

 

= 200.000 - 199.997 = 0.00300.

2 6

 

________________ ________

é 2 é 2

x' = 200. + Ö 400.*10 - 1.00 = 200. + Ö 400.*10 =

1 3 3 3

 

= 200. + 200. = 400.;

3

 

x' = 200. - 200. = 0.

2 3

 

 

x' -

1 1 0.003 -6 -5

d = ----------- = -------- = 7.5 * 10 < 10;

1 399.997

1

 

x' -

2 2 0.003

d = ----------- = ------- = 1.

2 0.003

2

 

: (d = 1/2 *10-2); .

ֳ, , ³

 

x'' = 1 / x' = 0.0025 = 0.003,

2 1

 

x'' -

2 2 0.003 - 0.0025

d = ------------ = -------------- = 0.17.

2 0.003

2

 

5.2.

 

S = 100 + 0.499 +. .. + 0.499.

___________________

100

 

. S = 100+100*0.499 = 149.9.

 

S = (...((100. + 0.499) + 0.499) + ...) + 0.499 = 100.

1 3 3 3 3

 

S = 100. + ((0.499 + 0.499) + (0.499 + 0.499) + ...) =

2 3 3 3 3 3

 

= 100. + (0.998 + 0.998 + ...) =

3 3 3

 

= 100. + ( 2.00 + ... ) = 100. + 50.0 = 150.

3 3 3

 

,

 

49.9

d = ------- = 0.33

1 149.9

 

 

0.1 -3

d = ------- = 0.66 * 10 ,

2 149.9

 

500 .

 

[̲] [] []