How do programming languages handle huge number arithmetic

前端 未结 9 1150
清酒与你
清酒与你 2021-02-05 19:35

For a computer working with a 64 bit processor, the largest number that it can handle would be 264 = 18,446,744,073,709,551,616. How does programming languages, say J

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-05 20:16

    More-or-less the same way that you do. In school, you memorized single-digit addition, multiplication, subtraction, and division. Then, you learned how to do multiple-digit problems as a sequence of single-digit problems.

    If you wanted to, you could multiply two twenty-digit numbers together using nothing more than knowledge of a simple algorithm, and the single-digit times tables.

提交回复
热议问题