Re: computing 20! all the way
Re: computing 20! all the way
- Subject: Re: computing 20! all the way
- From: Doug McNutt <email@hidden>
- Date: Fri, 12 Nov 2004 11:20:22 -0700
At 09:14 -0800 11/12/04, Christopher Nebel wrote:
>(In fact, the answer for 20! will be accurate, because it while it's 19 digits long, the last four are zero. 21! would not be, however.)
Now that's cute. In the binary representation it's divisibility by 2 that produces a trailing 0 and there are ten even multiplicands in 20! so the binary representation is at least equivalent to 64 bit precision instead of 54.
It would be interesting to see if the binary to decimal conversion in AppleScript can handle it somehow. I suspect it arbitrarily rounds to 15 decimals. Can one cast a float to a longint in AS?
set thebits to bits of afloat as list -- perhaps
What are the prime factors of 20! ? Some of the digits will add more than one binary zero at the right.
2 - 1
4 - 2
6 - 1
8 - 3
10 - 1
12 - 2
14 - 1
16 - 4
18 - 1
20 - 3
Summing, 19 zeros at the right end of the result can be shifted into the floating point characteristic before precision is actually lost.
There is some interesting numerology here but it's hardly AppleScript.
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
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