• 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: Brian Johnson <email@hidden>
  • Date: Thu, 11 Nov 2004 18:44:37 -0800 (PST)


Thanks to those who suggested (1)Maple, (2) python (compact!), (3) bc (new to me), and (4) reduced manual calculation. As a "vanilla applescript" exercise I took a crack at doing it the "old fashioned way" (aka, the hard way) by mimicking long-form multiplication on two arbitrary lists of base-10 digits. I'm happy to say that they all agree (and if anyone wants an (almost completely genericized) integer product routine for any size integer, email me. It's not very pretty, but it works).


  - brian johnson

On Thu, 11 Nov 2004, Brian Johnson wrote:


My daughter is sitting here with an assignment to calculate 20!

I did the obvious:

 set p to 1
 repeat with i from 1 to 20
	set p to i * p
 end repeat
 p
--> 2.43290200817664E+18

but it's wanted as a whole number (no scientific notation). Any suggestions? Cobol? used to tolerate really big integers, iirc, but can AS deal with this?

- brian johnson

_______________________________________________
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

_______________________________________________
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: Chris Espinosa <email@hidden>
References: 
 >Re: GUI Scripting and Acrobat 6 Pro (From: Bill Cheeseman <email@hidden>)
 >computing 20! all the way (From: Brian Johnson <email@hidden>)

  • Prev by Date: Re: computing 20! all the way
  • Next by Date: Re: creating a list of integers from a range
  • Previous by thread: Re: computing 20! all the way
  • Next by thread: Re: computing 20! all the way
  • Index(es):
    • Date
    • Thread