Joke Collection Website - Cold jokes - A binary algorithm for finding 0.5. Xiangxi

A binary algorithm for finding 0.5. Xiangxi

Decimal decimal to binary is rounded by multiplying by two, such as 0.625.

0.625 * 2 = 1.25 ... Round 1 up to 0.25.

0.25 * 2 = 0.5 ... rounded to the nearest 0.5.

0.5 * 2 = 1 ... turn 1+0.

Write down the integer of each step from top to bottom and connect it to 0. That is, 0. 10 1 is the converted binary number.

If it is 0.5, directly

0.5*2= 1, rounded to an integer, 1 is greater than 0.

So the result is 0. 1