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….我有很多,内存升级时59分,共1.5k的RAM ,热敏打印机和磁带驱动器,不用说这需要一个非常强大的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 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!所以我有一个问题,我想解决的问题,什么是阶乘为1万美元, 1000000 ! 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.我能拿出一个简单的常规,打破了计算成小块很容易处理的任何可编程计算器或PC 。
10 input x 10个输入x
20 for a = 1 to x 20对= 1为x
30 b = b + log10(a) 30 b = b的+ log10 (一)
40 next a明年1 40
50 c = b - frac(b) 50的C =数b -分数(二)
60 d = b - c 60 d = b的-ç
70 e = 10 ^ d 70 é = 10 ^ d
80 print e , “E+” , c 80打印E类, “ E + ”和c
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来计算1000000 ! ,现在需要大约1秒钟,我现在可以理解多少表现了我的笔记本,但是我的小程序仍然打破了在WindowXP计算器阶乘.. try it and see.尝试看看。
So what is 1 million Factorial?那么什么是100万阶乘? 1,000,000! 1,000,000 ! = 8.263930499EXP5565708, that 5.5 million zeros, give or take a few. = 8.263930499EXP5565708 ,即550万零,给予或需要几分钟。
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.如果您已设法保持兴趣和去年底这个职位,也许你的类型谁可以打动他们的朋友有些怪异的代码。
This post is tagged这个职位标签 factorial 1 million阶乘100万 , , factorial one million阶乘100万 , , logs日志 , , The First Program I Ever Wrote第一个节目是我写














2 Comments 2评论
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打卡编程脂蛋白
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据计算阶乘1000000在4分钟持平,不坏的温顺计算器
Incoming Links传入链接
Leave a Reply留下一个回复