Results 1 to 4 of 4

Thread: Large Number Handling in C

  1. #1

    Thread Starter
    Hyperactive Member VBD's Avatar
    Join Date
    Apr 2001
    Location
    The Place Above The Place Below Heavin
    Posts
    278

    Large Number Handling in C

    I'm trying to find to prime numbers that when multiplied equal a large number. I have the program written in C. Currently it uses Integers. When I try to use a float, it gives of odd results. It doesn't loop correctly or do anything correctly. I don't think a float is large enough anyway. I need to be able to work with 100+ digit numbers... Any ideas?

    (Yes, if you want to guess this is for the RSA Challange._I have no chance but I can dream...)
    Hello

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    the finding prime number site gives you the code
    (and yes i believe they do work with a large number of digits)

    have a look at __int64

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Even unsigned 64-bit integers can only store up to (2^64)-1 - not enough.

    You'll have to write your own large-number class or get one from the web.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    The Dartmouth MPI library is designed for working with integers of VERY large precision - it's free and is meant to work with C on
    under Windows and a bunch of *nix boxes.

    http://thayer.dartmouth.edu/~sting/mpi/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width