How to handle big integers in C

后端 未结 5 1460
无人及你
无人及你 2021-01-13 13:26

I want to implement cryptography algorithms. So I need a suitable data type to handle integers with a lot of digits.

Many recent languages, such as Java, Python and

5条回答
  •  借酒劲吻你
    2021-01-13 13:40

    I would first off highly suggest using an already existing library.

    However, I have done this before in the past as an experiment. I choose option 2. Representing a value like "10000000002000000000" as

    int array[2] = { 1000000000, 2000000000 } 
    

    and performing operations and carry values one int at a time. Not very efficient, but functionally sound.

提交回复
热议问题