Unlimited-precision integer library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Theese

    Unlimited-precision integer library


    Hello all,

    Can anybody recommend a freely-available library that provides
    unlimited-precision integers? All of the standard arithmetic operations
    would need to be supported as well as construction from a std::string and
    representation as a std::string. For example, something along these lines:

    unlimited_int
    foo("6823462683 497834734297823 497843296723484 385723458234623 498243798423789 4
    237982349824398 42398");
    cout << foo + 1 << endl;

    Thanks in advance!
    Dave

    P.S. I believe such a library is under development in Boost, but is not yet
    available. My desire would be to use this with the rational number library
    from Boost, and then in turn use that with a matrix manipulation library to
    do unlimited-precision matrix operations. Taking inverses, doing Gaussian
    elimination, etc... can result in some mighty ugly rationals...


  • Frank Schmitt

    #2
    Re: Unlimited-precision integer library

    "Dave Theese" <cheeser_1998@y ahoo.com> writes:
    [color=blue]
    > Hello all,
    >
    > Can anybody recommend a freely-available library that provides
    > unlimited-precision integers? All of the standard arithmetic operations
    > would need to be supported as well as construction from a std::string and
    > representation as a std::string. For example, something along these lines:
    >
    > unlimited_int
    > foo("6823462683 497834734297823 497843296723484 385723458234623 498243798423789 4
    > 237982349824398 42398");
    > cout << foo + 1 << endl;[/color]

    Have you checked the Available C++ Libraries FAQ? It's posted here regularly.
    Also, you might want to check out GMP (http://www.swox.com/gmp/).

    HTH & kind regards
    frank

    --
    Frank Schmitt
    4SC AG phone: +49 89 700763-0
    e-mail: frank DOT schmitt AT 4sc DOT com

    Comment

    • John Harrison

      #3
      Re: Unlimited-precision integer library


      "Frank Schmitt" <frank.schmitt@ 4sc.com> wrote in message
      news:4cad9wsxh9 .fsf@scxw21.4sc ...[color=blue]
      > "Dave Theese" <cheeser_1998@y ahoo.com> writes:
      >[color=green]
      > > Hello all,
      > >
      > > Can anybody recommend a freely-available library that provides
      > > unlimited-precision integers? All of the standard arithmetic operations
      > > would need to be supported as well as construction from a std::string[/color][/color]
      and[color=blue][color=green]
      > > representation as a std::string. For example, something along these[/color][/color]
      lines:[color=blue][color=green]
      > >
      > > unlimited_int
      > >[/color][/color]
      foo("6823462683 497834734297823 497843296723484 385723458234623 498243798423789 4[color=blue][color=green]
      > > 237982349824398 42398");
      > > cout << foo + 1 << endl;[/color]
      >
      > Have you checked the Available C++ Libraries FAQ? It's posted here[/color]
      regularly.[color=blue]
      > Also, you might want to check out GMP (http://www.swox.com/gmp/).
      >
      > HTH & kind regards
      > frank
      >[/color]

      NTL is another possibility. http://www.shoup.net/ntl/

      john


      Comment

      Working...