red_coder's blog

By red_coder, 13 years ago, In English

Hey guys i was wondering just like BigInteger in Java is there any way to handle very large numbers along with all the arithmetic operations in c++....

  • Vote: I like it
  • -20
  • Vote: I do not like it

| Write comment?
»
13 years ago, hide # |
Rev. 2  
Vote: I like it +11 Vote: I do not like it

No , you have to handle it in array

you can code a class or data struct to handle big numbers

  • »
    »
    13 years ago, hide # ^ |
     
    Vote: I like it -27 Vote: I do not like it

    no there must be some way i am sure. Handling with array may create some problems and also too much code to write manually for implementation.

    • »
      »
      »
      13 years ago, hide # ^ |
       
      Vote: I like it +1 Vote: I do not like it

      If the competition allows pre-written code, then there is no problem. Otherwise, addition, subtraction, multiplication and division by a small number are easily implementable within minutes (try to write them one or two times and you'll get the feel of it).

      The is no support for big numbers in the standard library, so the above is the only thing you can do.

    • »
      »
      »
      13 years ago, hide # ^ |
       
      Vote: I like it +10 Vote: I do not like it

      Yes, there is well-known way — as I know most of C++ contestants with high rating have sufficient skills in java and use this language for these rare problems.

»
13 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can use Gmp in use normal,but in competition search or create your own implementation.

»
13 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

the best solution i see is to learn some basic java....