Thread: Big numbers...

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    9

    Big numbers...

    Hello,

    I am working on large number theory and i need to work with numbers up to 1.00x10^700 What are my options? From what i understand C++ wont work because it can only deal with numbers: 2.2^-308 to 1.8^308

    Thanks!

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    In theory, you can use long doubles, which are 80 bit extended floating point types & go up to something like 1E4100.

    If you are using MSVC, this option is closed to you as VC maps long doubles to doubles.

    However, the Borland compilers support long doubles along with a set long extended math routines.

    You could also try GCC, but I've never used it, so can't comment.

    Or - alternatively you can get your hands on an extended floating point class. This would not be dependent upon the FPU and precision and range would be arbitrary. The down side would be that calculation is slower.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    9
    Thanks... I have borland5.5 free complier...but that doesnt seem to want to handle long doubles... any suggestions?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory issue
    By t014y in forum C Programming
    Replies: 2
    Last Post: 02-21-2009, 12:37 AM
  2. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  3. Problem with adding up numbers from a txt file
    By Leo12 in forum C Programming
    Replies: 1
    Last Post: 02-18-2009, 01:50 PM
  4. Big (and small) numbers...
    By swif in forum C Programming
    Replies: 6
    Last Post: 04-22-2005, 12:21 PM
  5. Program that prints numbers in columns
    By rayrayj52 in forum C++ Programming
    Replies: 12
    Last Post: 09-20-2004, 02:43 PM