Thread: Variables longer than double or long int

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    2

    Variables longer than double or long int

    I've been trying to use C++ for running math equations. A recent problem i've found is the limit for size on variables.
    I am trying to find a way to solve for numbers, and use numbers in equations, that are much longer than even long int.
    I'm trying to use numbers that are tens of digits long and still retain accuracy. After doing some searching on it,
    I still haven't found any way to accomplish this in C++. If anyone could help, or knew any books that would have an answer,
    I'd appreciate it greatly. Thanks for your time.


    -Lucid

  2. #2
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    You can check out GMP, which is a C/C++ library for large number operations.
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    2
    Thanks for the link. That sounds like exactly what I was looking for.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  2. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  3. Game Won't Compile
    By jothesmo in forum C++ Programming
    Replies: 2
    Last Post: 04-01-2006, 04:24 PM
  4. Replies: 2
    Last Post: 03-24-2006, 08:36 PM
  5. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 05:26 PM