Блог пользователя thanhchauns2

Автор thanhchauns2, история, 3 года назад, По-английски

I just want to share something to community, after I found this problem in the problemset (which the answer cannot be display as long long integer). Here is my class to calculate on strings (including add, substract, multiply, divide (as two strings), modulo and take gcd, I will add bitwise operators later if possible).

Hope you will find it useful. If you find this incomplete, I would love to read any feedback.

Code

Hope you will find this helpful ^_^ Thanks for reading.

  • Проголосовать: нравится
  • +24
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

this looks decent, but there's a better way of implementing bigint: splitting the digits into a group of, say, 10 digits or 20 digits, each group then can be displayed as an integer, operations will be faster and much simpler to store (which is how many bigint templates are implemented)