thanhchauns2's blog

By thanhchauns2, history, 16 months ago, In English

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.


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

  • Vote: I like it
  • +24
  • Vote: I do not like it

16 months ago, # |
  Vote: I like it +6 Vote: I do not like it

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)