|
I don't think even the windows calculator can calculate 922!. That's a decent size number.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
For being sort of serious: When we were student, long ago, someone picked up a claim that with our latin alphabet, it would in principle be possible to create 20,000! different English words. To find out what that meant, one of my fellow students wrote a small routine on his calculator, while I wrote a program using 64 bit precision.
When we compared the results, he was proud that his calculator differed only by a factor of three. Now, that wasn't a linear factor of three, compared to the huge mainframe computer. In fact, it was the magnitude of the exponent of the result... The exponent of his calculator result differed by about 2000, compared to the mainframe. The error in the exponent was of magnitude three. That's about a factor of three, isn't it?
Now, even 64 bits of precision is far from sufficient to hold 20,000! without loss. So I cannot claim that my result was "correct" - but my fellow student accepted it as such. Unfortunately, I didn't save the program code (nor my fellow student's calculator program), so I can't verify which is most correct. Maybe his program came closer to the correct value!
|
|
|
|
|
How long did it take to calculate?
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I don't have a memory of it, but consider: It is just 20.000 multiplications. That shouldn't take to long!
double fact(int i) {
double result = 1.0;
for (int factor = 1; factor <= i; factor ++) result *= factor;
return result;
} ... or something like that. (I didn't run this through a compiler, but I think it is reasonably obvious code.)
Now that I look at it: The IEEE 754 format would not be able to handle 20,000! even in 64 bit format. When we did this calculation, in 1977-78, IEEE 754 was not established, so we used whatever format was available at that CDC mainframe. I cannot recall the details of that format, or whatever workaround we used to overcome the range limitations.
Neverhteless: Even if I were to repeat the experiment, using one of the many infinite-precision packages available today, it still would requre only 20,000 extended precision multiplications. Even in arbitrarily extended precision, a multiplication won't take that much time. Actually, I suspect that if your extended precision package is binary based, converting the result to an ASCII digit stream would be more time consuming than doing the 20,000 multiplications. Maybe even doing the multiplications in decimal, digit-by-digit format, would be time-saving, compared to the lengthy division operations required for the printout.
bonus chatter:
As students, we wrote an extended precision package for a fellow student in "Theoretical Physics" working on a model to simulate two colliding waves. His initial model displayed some rather unlikely artifacts, such as resulting waves having 90 degrees corners. So we made him a library which, by 200 decimal digits, gave him the precision to model these waves properly.
In the process, we realized that he had no understanding whatsoever for the importance of adding the elements of a series expansion from the smaller to the larger. He was in theoretical physics, where the order of the addends has no importance, theoretically. He was completely unable to understand that in practice, there is a difference. ("In theory, there is no difference between theory and practice, but in practice there is" ...) Most likely the native 72 bits precision of the Univac 1100 mainframe computer would have been more than sufficient if he had only learned to add the series from the other end!
|
|
|
|
|
A good way to approximate large factorials is Stirling's Formula:
ln(N!) ~ N*ln(N) - N
Using my trusty Windows calculator, 20000! is approximately 1077,334. You definitely could not have calculated it by simple multiplication...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
You're holding it wrong! ~Steve Jobs
If you hold it properly, it'll delete.
|
|
|
|
|
Do you need to lick it first?
|
|
|
|
|
Only if it is a fossil.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Mynewkeyboardhasabiglongkeyatthebottomwithnowritingon.Godknowswhatitdoes
|
|
|
|
|
dell ?
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
Yup.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
If you don't know it: keyTweak... a free piece of code that will help reassigning keys...
Hope this helps.
|
|
|
|
|
Finally!
About 12 times, I've set aside a couple of weeks to finish the damned thing, but each time the best laid plans manually selected with my mouse went sideways.
It ended up taking nearer three weeks, plus a day or so for line/continuity editing.
It's in the same places as before, Chaps.
• If you don't remember where that is: use my personal e-mail addy
• If you also don't remember my personal e-mail addy: you'm buggered, amn't ya?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
923
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
924 (blech)... 925... 926... 927...
928[^]
Software Zen: delete this;
|
|
|
|
|
|
PIEBALDconsult wrote: Grotty
Oh, boy another Britishism for my collection.
Seriously. I have learned things like, "git" and others here and it's always exciting to log another.
|
|
|
|
|
922, 923, what ever it takes.
(allusion to the movie "Mr. Mom" in case you're wondering)
|
|
|
|
|
Great movie.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
NO! I DON'T wanna go see a band called "Parking Violation" at "The Courthouse"!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
You're missing out.
|
|
|
|
|
The tickets are too expensive!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
If you ignore the flyers long enough, they'll make arrangements so you don't receive them anymore.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Then you become part of that band's captive audience.
|
|
|
|
|
Hey! The sign said fine for parking.
Socialism is the Axe Body Spray of political ideologies: It never does what it claims to do, but people too young to know better keep buying it anyway. (Glenn Reynolds)
|
|
|
|