Todays post is in response to a good friend of mine always asking about the “Mumbo Jumbo” that I talk about or create during the course of my job.今天的职位是我一直十分关注“无意义”,我对或创建期间,我的工作当然谈话,要求回应的好朋友。 “Mumbo Jumbo” is actually “Japanese English” for technical talk according to some. “无意义”,实际上是“日本的技术讲英语”根据一些。 I have to take you all back to when I was about 14 years old, this is when I purchased my first computer.我要带你们回在我差不多14岁,这是当我购买了我的第一台计算机。 My first computer wasn't an IBM 486 or 386, or even a 286, my first computer was a Casio PB-100.我的第一台电脑不是IBM的486或386,甚至是286,我的第一台计算机是卡西欧铅- 100。
Here are the details of my first PC.这里是我的第一台个人电脑的细节。

The PB-100 represents Casio's step towards “real” pocket computers.在PB - 100是卡西欧的走向“真正的”掌上电脑的一步。 While its ancestor, the而其祖先的 FX-702P外汇- 702P , was still called “Programmable Calculator”, the PB-100 proudly bears the title “Personal Computer”. ,仍称为“可编程计算器”,在PB - 100自豪的标题是“个人电脑”。
In its standard version, it is equipped with 1 KB of RAM which results in only 544 bytes for BASIC, which is really limiting.在标准版本,它配备了1 KB的RAM只有544的基础,这实在是个字节的限制的结果。 At least, with the memory module OR-1, it can be upgraded to 1568 bytes of user memory, so it begins to make sense that BASIC memory can be subdivided into 10 independent program areas.至少,与内存模块或- 1,可以升级到1568字节的用户内存,因此它开始有意义的基本的内存可分为10个独立的项目领域划分。
The main circuits of the PB-100 are basically made up of two chips.在PB的主要电路- 100,基本上是由两个芯片。 Processor logics, ROM, display driver, and keyboard controller are integrated in a single CMOS VLSI chip HD61913, which has an external 4-bit bus.处理器逻辑,光盘,显示驱动程序和键盘控制器被整合在单一CMOS超大规模集成电路芯片HD61913,它有一个外部的4位总线。 The second main component is a HD61914, which is a 8192-bit static RAM organized as 2048 words by 4 bits.第二个主要组件是一个HD61914,这是一个8192位的静态RAM为2048字由4位组织。
I had the lot, 1k ram upgrade for a total of 1.5k of ram, thermal printer and tape drive, needless to say it want a very powerful PC, but you would be surprised what could be done with such an underpowered PC, keep reading….我有很多,为的RAM总数1500人,热敏打印机和磁带驱动器,不用说,想要一个非常强大的PC经销商内存升级,但是你会感到惊讶什么可以做这样一个动力不足的PC,请继续阅读...。
My first program was written in BASIC, and could calculate the Factorial of any number you like.我的第一个纲领,基本写的,可以计算出你喜欢的任何数字因子。 What is Factorial ?因子是什么? In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n.在数学中,阶乘的一个非负整数n,由N记!,是所有正整数的乘积小于或等于n For example, 5!例如,5! = 1 x 2 x 3 x 4 x 5 = 120 and 6! = 1 × 2 × 3 × 4 × 5 = 120和6! = 1 x 2 x 3 x 4 x 5 x 6 = 720. = 1 × 2 × 3 × 4 × 5 × 6 = 720。 As you can imagine the numbers get very large very quickly.正如你能想象得到的数目非常大的非常快。 Most calculators, even today, can only manage 69!, this is the point where the exponent exceeds 99.大多数计算机,即使在今天,只能管理69!,这是点的指数超过99。
So I had a problem I want to solve, what is the factorial of 1 million, 1,000,000!所以,我有一个问题,我想要解决的,什么是100万的阶乘,100万! logarithms to the rescue.营救对数。 What is a 14 year old boy doing researching logarithms you ask?什么是14岁的男孩做研究,对数你问? I guess thats a story for another post.我想多数民众赞成在另一个职务的故事。 After a few hours of reading a book, yes a book!( no internet in those days) I was able to establish that product of integers is the sum of their logs.后读一本书几个小时,是一本书!(没有互联网,在那些日子里)我能确定的整数产品是他们的日志总和。
so 1 * 2 * 3 * 4 * 5 … is equal to exp( log(1) + log(2) + log(3)+ log(4) + log(5) )所以1 * 2 * 3 * 4 * 5 ...等于进出口(日志(1)+日志(2)+日志(3)+日志(4)+日志(5))
Easy right… yeah right!易权的权利...呀!
So I embarked on my first programming task.因此,我开始了我的第一个编程任务。 I was able to come up with a simple routine that broke the calculation down into small chunks easily handled by any programmable calculator or PC.我能拿出一个简单的例行公事爆发计算分解成容易被任何可编程计算器或电脑处理小块了。
10 input x 10输入x
20 for a = 1 to x 20 1 = 1到x
30 b = b + log10(a) 30个B二B + log10(1)
40 next a 40下一页1
50 c = b – frac(b) 50架C = B组-压裂(二)
60 d = b – c 60天= B组-荤
70 e = 10 ^ d 70条= 10 ^Ḏ
80 print e , “E+” , c 80列印E类,“E +”,ç
Certainly not the best way to achieve the result by todays standards, and faced with many command restrictions, still not to bad for a 14 year old boy.当然不是最好的方法来达到以今天的标准,这与许多面临命令限制,仍有一名14岁的不坏岁男童。
You can still use this program today, go and download您仍然可以使用该程序的今天,去下载 small basic小基础 and copy/paste the code and give it a try.并复制/粘贴代码,并给它一试。 It took more than 12 hours on my PB-100 to calculate 1,000,000!, now it takes about 1 second, I can now appreciate how much performance my laptop has, however my little program still beats the WindowXP calculator at Factorial..花了超过12小时,我铅- 100来计算1,000,000!,现在需要大约1秒钟,我现在可以理解的表现多少我的笔记本电脑了,但我的小程序仍在跳动的因子的WindowXP计算器.. try it and see.尝试看看。
So what is 1 million Factorial?那么,什么是一百万因子? 1,000,000! 1,000,000! = 8.263930499EXP5565708, that 5.5 million zeros, give or take a few. = 8.263930499EXP5565708,即550.000万零,给予或需时数。
Now for all the other math heads who read this, I know it is an approximation as I am only using 16 significant digits, and there are more accurate ways to do this, blah blah blah, please remember I was only 14 at the time.现在所有其他数学主管谁读这一点,我知道这是一个近似值,因为我只用16位有效数字,而且有更准确的方法来做到这一点,等等等等等等,请记得我当时只有14个。
If you have managed to maintain interest and get to the end of this post, maybe your the type who can impress their friends with some geeky code.如果你有兴趣管理,以保持和到达这个帖子的末尾,也许你的类型谁能够打动一些古怪的代码的朋友。
To get new stuff automatically subscribe to my要获得新的东西,我会自动订阅 RSS feed RSS提要 . 。 For a more personal insight Follow me on对于更多的个人见解跟我上 Twitter叽叽喳喳 . 。
This post is tagged这个职位是标签 factorial 1 million阶乘100.0万 , , factorial one million阶乘一百万 , , logs日志 , , The First Program I Ever Wrote第一个程序我曾经撰写














4 Comments 4评论
Pauly, do you remember where you got the workings from ?…… It was me who brought the Swinburne Uni PC's to a grinding hault in the early eighties with this Factorial Formulae on PUNCH CARDS… YES!保利,你还记得您得到了从运作?... ...这是我谁带来的斯温伯恩统一电脑来处理这个问题穿孔卡片阶乘公式...是八十年代初磨hault! punch card programming LOL打卡编程LOL
Reply To This Comment回复此评论
Remember my Casio Calculator the FX-602P??记住我的卡西欧计算器的FX - 602P?? It computed 1,000,000 factorial in 4 minutes flat, not bad for a meek calculator它在计算1,000,000因子4分钟持平,而不是一个温顺的计算器坏
Reply To This Comment回复此评论
Thanks!谢谢! Believe it or not, I was actually trying to solve 1000000!相信与否,我实际上是试图解决的1000000! , but, yes, my sci calculator was only good for 69!但,是的,我的科幻计算器只有良好的69! . 。 My windows sci calculator was much better.我的Windows科学计算器就好多了。 It took me up to (10^5)!我花了最多(10 ^ 5)! , but it wouldn't give me (10^6)! ,但它不会给我(10 ^ 6)! . 。
I tried some online calculators , but they couldn't even come close to the windows sci calculator.我尝试一些在线计算器,但他们甚至无法接近窗户科幻计算器。 For now, and for my purposes, all I needed was that answer.现在,和我的目的,所有我需要的是确切的答案。 I'll search for a calculator later.我要寻找一个计算器以后。 Thank you, again, you have saved me a lot of search time.谢谢你,再次,你救了我的搜索时间。 As I am rural, I only have dial-up.由于我的农村,我只有拨号。 Yes, it only feels like it would be faster to just 1 x 2 x 3 x 4 x 5 x ………….with pencil and paper (how many life-times????).是的,它只是喜欢它的要快到1 × 2 × 3 × 4 × 5 × ... ... ... ...用铅笔和纸(多少生命。倍????). than to search for the answer.而不是寻找答案。 and wait for the snail-speed downloads!!!!并等待蜗牛高速下载!!
Appreciatively,感激地,
Chris Aristides Pappas克里斯阿里斯蒂德帕帕斯
Reply To This Comment回复此评论
-Paul 保罗 Reply:回复:
September 8th, 2009 at 8:34 am 9月8日在8时34分,2009分
I'm glad you found it useful.我很高兴你发现它非常有用。 I'm also glad I'm not the only geek who has an interest in factorial of large numbers.我也很高兴,我不是唯一的怪胎谁拥有的兴趣大量的阶乘。
Reply To This Comment回复此评论
Incoming Links接踵而来的链接
Leave a Reply留下回复