How do programming languages handle huge number arithmetic

前端 未结 9 1147
清酒与你
清酒与你 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:24

    Think of one machine-size number as a digit and apply the algorithm for multi-digit multiplication from primary school. Then you don't need to keep the whole numbers in registers, just the digits as they are worked on.

提交回复
热议问题