How to implement big int in C++

前端 未结 13 1895
攒了一身酷
攒了一身酷 2020-11-22 07:48

I\'d like to implement a big int class in C++ as a programming exercise—a class that can handle numbers bigger than a long int. I know that there are several open sou

13条回答
  •  孤街浪徒
    2020-11-22 08:06

    Don't forget that you don't need to restrict yourself to 0-9 as digits, i.e. use bytes as digits (0-255) and you can still do long hand arithmetic the same as you would for decimal digits. You could even use an array of long.

提交回复
热议问题