• 家庭
  • |
  • 關於
  • |
  • 檔案
  • |
  • 相集
  • |
  • 國外工作
  • |

2月
07
我寫的第一個節目
Translate to EnglishÜbersetzen Sie zum Deutsch/GermanПереведите к русскому/RussianΜεταφράστε στα ελληνικά/GreekVertaal aan het Nederlands/Dutchترجمة الى العربية/Arabic中文翻译/Chinese Traditional中文翻译/Chinese Simplified한국어에게 번역하십시오/Korean日本語に翻訳しなさい /JapaneseTraduza ao Português/PortugueseTraduca ad Italiano/ItalianTraduisez au Français/FrenchTraduzca al Español/Spanish

今天崗位以回應我的好朋友總詢問「晦澀難懂的話」那我在我的工作期間談論或創造。 「晦澀難懂的話」為技術談話實際上是「日英」根據一些。 我必須採取您全部回到,當我是大約14年,這是我購買了我的第一臺計算機。 我的第一臺計算機不是IBM 486或386,甚至286,我的第一臺計算機是Casio PB-100。

這我的第一臺個人計算機細節。

Casio鉛100

PB-100代表Casio的步往「真正的」口袋計算機。 當它的祖先,時 FX-702P仍然叫「可編程序的計算器」, PB-100驕傲地具有標題「個人計算機」。

在它的標準版本,它裝備以只導致544個字節為BASIC,真正地限制的1 KB RAM。 至少,用記憶模塊OR-1,它可以被升級到用戶記憶1568個字節,因此它開始有道理BASIC記憶可以被細分入10個獨立節目區域。

PB-100的主要電路基本上由二塊芯片做成。 處理器邏輯、ROM、顯示司機和鍵盤控制器在一塊唯一CMOS VLSI芯片HD61913集成,有一輛外在4位公共汽車。 第二個主要成份是HD61914,是8192位靜態RAM被組織作為2048個詞由4位。

我有全部, 1k公羊升級為總共公羊,感熱式印字機1.5k,并且磁帶驅動器,多餘說它想要一臺非常強有力的個人計算機,但您會驚奇什麼可能做與underpowered個人計算機,保留讀書….

我的第一個節目被寫用BASIC,并且可能計算您喜歡的階乘所有數字。 什麼是階乘的? 在數學,階乘一個非負整數n,由n表示! 是所有正面整數小於或等於n.產品。 例如, 5! = 1 x 2 x 3 x 4 x 5 = 120和6! = 1 x 2 x 3 x 4 x 5 x 6 = 720。 您能想像數字非常迅速得到非常大。 多數計算器,甚而今天,可能只處理69! 這是點,方次數超出99。

如此我有我想要解決的一個問題,什麼是階乘的1百萬, 1,000,000! 對數到搶救。 什麼是一個14歲男孩做研究您要求的對數? 我猜測是一個故事為另一個崗位。 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) )

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
20 for a = 1 to x
30 b = b + log10(a)
40 next a
50 c = b - frac(b)
60 d = b - c
70 e = 10 ^ d
80 print 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.

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.. try it and see.

So what is 1 million Factorial? 1,000,000! = 8.263930499EXP5565708, that 5.5 million zeros, give or take a few.

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.

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.

.......................................................................

 




Read More


Google
Post a comment
Name:
Email:
URL:
Comments:
Google


  • Currently Viewed

    • Crackatinni Tribe
    • Left Brain vs Right Brain Colour Test
    • Don't Give Up on Vista
    • Pearl Fuji-san
    • Jailbreak 1.1.2
  • Subscribe

    • Subscribe via Feed Burner
  • Friends




  • Blogroll

    • Diva Blogger
    • Evil Woobie
    • JapanSoc
    • jDonuts
    • Learn Japanese Igo
    • My English is Engrish
    • My Life as a Gaijin
    • Neil Duckett
    • Photo Hunt
    • The JLPT Study Page
  • Home
  • |
  • About
  • |
  • Archives
  • |
  • Photo Gallery
  • |
  • Work Overseas
  • |

Recent Readers
Featured Photos
Advertisers
Entre Card Stumble Cheats
Related Sites | Link Exchange | My Webring