Skip to Content
深入理解運算原理|從簡單的機器到無所不能的程式
book

深入理解運算原理|從簡單的機器到無所不能的程式

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
Toyland 程式設計
|
299
圖的確保留了規劃旅途必需的最重要資訊:所有城鎮的相對位置、通往每個城鎮的道
路,以及這些道路如何相互連接。
儘管缺少了所有的細節,但準確的地圖還是很有用,因為你規劃的路線不僅在地圖的抽
象世界有效,在現實中很可能也有效。地圖製作者已經完成了創造真實模型的昂貴工
作,讓你藉著檢視簡化的路網表示方式並以其規劃你的路線,而有機會對該模型執行運
算。然後當你實際鑽進汽車並開到目的地的時候,你可以將如此的運算結果轉移回到現
實世界,並且允許在地圖的抽象世界做出廉價的決定,以防止你在實體道路必須做出昂
貴的決定。
地圖所用的近似值讓導航運算更為容易,而不會對它們結果的忠實程度造成致命妥協。
以地圖所做的決定在有很多情況可能會是錯的(無法保證地圖絕對能告訴你旅途必須知
道的
所有一切
),但事先規劃你的路線可以排除特定的各種錯誤,讓從某一地到另一地
的整個問題變得更容易管理控制。
抽象體:乘法的正負號
用列印的地圖規劃路線是抽象解譯的真正應用,但卻也非常非正式。若要更為正式的例
子,我們可以看看數值的乘法;雖然它依然只是玩具範例,但乘法讓我們有機會開始編
寫程式碼來鑽研這些想法。
假裝乘以兩個數值的一小段時間是困難或所費不貲的運算,而我們對某些不必實際執行
就能找出的乘法結果資訊,很感興趣。具體來說:結果的
正負號
為何?結果是負數、
零還是正數?
所找到的方式(也是理論上所費不貲的方式),是在
具體的
世界使用乘法的標準解譯進
行運算:乘以實際的數值、檢視結果數值,並決定該結果是負數、零值還是正數。例如 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JSON實務手冊

JSON實務手冊

Tom Marrs

Publisher Resources

ISBN: 9789864766000