Re: Big/Arbitrary integers
Re: Big/Arbitrary integers
- Subject: Re: Big/Arbitrary integers
- From: Greg Herlihy <email@hidden>
- Date: Mon, 23 Jan 2006 18:39:28 -0800
- Thread-topic: Big/Arbitrary integers
If you are compiling with gcc 4.0, long double (at 128 bits, or about 33
decimal places of precision) is probably a better choice than
NSDecimalNumber at this point. In fact judging from Tiger's release notes
NSDecimalNumber appears to be destined for deprecation, once NSNumber adds
support for long double.
However neither long double nor NSDecimalNumber (nor the NSDecimal C
implementation upon which it is based) support arbitrarily large integers.
For a "native" implementation of a big integer library (that is one that
ships on every Mac), I would look at openssl's Big Number library whose
interface is found in <openssl/bn.h> and whose documentation can be found in
the "bn" man page and whose source can even be downloaded from the
openssl.org web site.
Greg
On 1/23/06 5:29 PM, "Adam Leonard" <email@hidden> wrote:
> Also take a look at NSDecimalNumber. From the docs:
> "An instance can represent any number that can be expressed as
> mantissa x 10^exponent where mantissa is a decimal integer up to 38
> digits long, and exponent is an integer from 128 through 127."
>
> Adam Leonard
> On Jan 23, 2006, at 4:19 PM, Shon Frazier wrote:
>
>> Is there a Cocoa API for arbitrarily large integers? I've searched
>> and cannot find any references in the ADC docs.
>> I'm aware the the GPL'd GMP library, but I'm hoping for something
>> more "native".
>>
>> Thanks in advance,
>>
>> --Shon
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden