Re: Handling calculations with many decimal places
Re: Handling calculations with many decimal places
- Subject: Re: Handling calculations with many decimal places
- From: Graham Cox <email@hidden>
- Date: Wed, 4 Nov 2009 01:37:36 +1100
On 04/11/2009, at 1:29 AM, Graham Cox wrote:
NSDecimal may help, but it's also of finite size, so it won't help
trying to print out the digits of pi to arbitrary precision, since
pi is infinitely long. Algorithms to print the digits of pi usually
emit the digits one at a time, so they are not storing the whole
value as a single number. You'll probably need to resort to this
sort of approach if you're just trying to calculate pi. To use the
resulting value of pi in a calculation is going to be very
difficult, and probably serves no practical purpose.
You could also try using code like this, which should be fairly easy
to port to Mac:
http://www.tc.umn.edu/~ringx004/mapm-main.html
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden