Does C ++ have an analogue of java.math.BigInteger?

  • Is it a 64-bit integer or for arbitrarily large numbers? - Vladimir Martyanov
  • already been. 1 , 2 . - KoVadim
  • @KoVadim, BigInteger implementations are also different. For example, the implementation of BigInteger from .NET and the implementation of java.math.BigInteger are different. - Alexis
  • Different languages, different implementation. But if the implementation considers that 2 + 2 = 7, then what is the difference, what language / platform / implementation. - KoVadim
  • @KoVadim, en.stackoverflow.com/questions/414022/… Productivity is very important in my case. - Alexis

3 answers 3

In the standard C ++ library at the moment - no.

boost::multiprecision contains corresponding counterparts. There is both an arithmetic of extended fixed width and dynamic ("infinite") width. There is both a C ++ shell for GMP (the latter must be set separately), and its own independent implementation.

    The standard language is not provided. Use one of the available libraries - like GMP

    • How, by the way, is she currently supporting Visual Studio? - Vladimir Martyanov
    • Although the link can find the answer to the question, it is better to point out the most important thing here, and give the link as a source. If the page to which the link leads will be changed, the response link may become invalid. - From the queue of checks - Kirill Stoianov
    • @KirillStoianov read the question and answer; removal is not required here. - Denis

    BigInteger - .NET Framework Structure

    Will do?

    https://msdn.microsoft.com/ru-ru/library/system.numerics.biginteger(v=vs.110).aspx

    • You have added an example link to a .NET implementation. The labels also indicate pure C ++, not CLI. - Alexis