Re: Big Int support
Re: Big Int support
- Subject: Re: Big Int support
- From: john gale <email@hidden>
- Date: Mon, 02 Jun 2003 16:48:08 -0500
would this really work, though? Here's from the documentation on
NSDecimalNumber:
NSDecimalNumber, an immutable subclass of NSNumber, provides an
object-oriented wrapper for doing base-10 arithmetic. 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.
hence, there wouldn't really be enough precision to detail all of
Chad's number:
(such as 2^1000 which is equal to
10715086071862673209484250490600018105614048117055336074437503883703510
51124936122493198378815695858127594672917553146825187145285692314043598
45775746985748039345677748242309854210746050623711418779541821530464749
83581941267398767559165543946077062914571196477686542167660429831652624
386837205668069376 according to Mathematica)
is there a class that could store and do arithmetic on an effectively
infinite number? certainly not infinite truly, but enough so that
precision is not lost when working with numbers like 2^10^100.
~ john
On Monday, June 2, 2003, at 12:39 PM, Clark S. Cox III wrote:
On Monday, Jun 2, 2003, at 13:28 US/Eastern, Chad Armstrong wrote:
Not exactly a Cocoa-related question, but it could be incorporated
into a Cocoa program. Is there a library or way to create 'big int'
support so a number isn't limited to the particular bounds of int,
float, or even an unsigned long?
Check out NSDecimalNumber.
=================
support the arts!
www.smadness.com
updated Jan 21 2003
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.