435,551 Members | 2,622 Online + Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Understanding problem of long numbers

 P: n/a Hi. My problem seems to be simple, but I can not figure out a solution. Problem: I have a number that consists of 128 bit. I want to compute its modulo (modulo is at the range < 2^16). So that there is no 128 bit datatype in C++ I just cannot imagine how I can work out qa solution for that. greets, Hipo Jun 15 '06 #1
4 Replies

 P: n/a Hipo wrote: Hi. My problem seems to be simple, but I can not figure out a solution. Problem: I have a number that consists of 128 bit. I want to compute its modulo (modulo is at the range < 2^16). So that there is no 128 bit datatype in C++ I just cannot imagine how I can work out qa solution for that. Basically you need to do a division with remainder. Think about how you do division with pencil and paper and try to apply this to the problem. You would need to represent your 128 bit quantity as several smaller integers that are representable in C++. Jun 15 '06 #2

 P: n/a Hipo wrote: Hi. My problem seems to be simple, but I can not figure out a solution. Problem: I have a number that consists of 128 bit. I want to compute its modulo (modulo is at the range < 2^16). So that there is no 128 bit datatype in C++ I just cannot imagine how I can work out qa solution for that. greets, Hipo Surely there's a big number library that does this? Maybe something like: http://indigo.ie/~mscott/ I've not used the library, but there's plenty of others around too. Jun 15 '06 #3 