• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: computing 20! all the way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: computing 20! all the way


  • Subject: Re: computing 20! all the way
  • From: Courtney Schwartz <email@hidden>
  • Date: Fri, 12 Nov 2004 11:44:33 -0500

:: digs through the language guide::

What about the data type Data? Would that work for this sort of thing?

Courtney Schwartz

On Nov 12, 2004, at 11:09 AM, Doug McNutt wrote:

At 17:37 +1100 11/12/04, Richard Morton wrote:

on factorial from n if n = 0 then return 1 return n * (factorial from (n - 1)) end factorial

That recursion is a good example of a technique that is useful for such things as traversing a directory tree in AppleScript but it won't solve the underlying question of this thread which is that IEEE floating point doubles (64 bits) simply will not support more than approximately 15 decimal digits of precision. One needs type extended (80 bits) which AppleScript will not do and it won't take much above 20! to exceed even that.


Character based techniques, as suggested by others, for arbitrary precision are probably best for such things but they are slow.

-- --> If you are presented a number as a percentage, and you do not clearly understand the numerator and the denominator involved, you are surely being lied to. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: computing 20! all the way
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: computing 20! all the way (From: Martin Orpen <email@hidden>)
 >Re: computing 20! all the way (From: Richard Morton <email@hidden>)
 >Re: computing 20! all the way (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: Delete an item in a list ?
  • Next by Date: Re: Delete an item in a list ?
  • Previous by thread: Re: computing 20! all the way
  • Next by thread: Re: computing 20! all the way
  • Index(es):
    • Date
    • Thread