long long long: Too long for GCC
How come I get this error described in the title and is there any way to assign a 128-bit hexadecimal value to a variable? If so, what libraries do you need to enable it? And if you do need libraries, are they in the Ubuntu repositories?
|
Hi -
The thing you're looking for is "big numbers" (aka "bignum"). Here's a good link for GCC: http://dl.fefe.de/bignum.pdf Interestingly, you *might* have an "__int128" type with your GCC compiler - check it out. Otherwise, the above link (or a Google search on "C/C++ bignum") might point you in the right direction. |
Also, the GNU Multiple Precision Library is popular for arbitrarily large numbers.
|
Yeah... Now how is the 'bignum_st' struct initialized?
Oh, and I also ran into another error that apparently the 'bignum.pdf' file didn't take into account: Code:
error: BN_ULONG doesn't name a type |
Anyone?
|
Hi -
1. You'd have to define BN_LONG yourself - presumably with a typdef. 2. I didn't mean the article as a complete, prêt-à-porter solution. I merely thought it would give you useful pointers for developing your own solution. More like an "algorithm", than code you could simply cut/paste. 3. If you want an "off the rack" solution, however, I'd encourage you to consider GMP (as others have also recommended). You might also want to consider Tom's Math library (also, along with GMP, mentioned in the article I cited): http://www.freshports.org/math/libtommath/ http://libtom.org |
All times are GMT -5. The time now is 10:41 PM. |