You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 10_binary_counter.html
+19-20Lines changed: 19 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -461,9 +461,7 @@ <h3>Counter storage</h3>
461
461
<p>I think it is very beautiful.
462
462
We could compete with Steve Jobs for elegance of our design<supid="fnref:11"><ahref="#fn:11" rel="footnote">11</a></sup>.</p>
463
463
464
-
<p><strong>Exercise:</strong> In <ahref="https://en.wikipedia.org/wiki/Numerical_analysis">numerical analysis</a>,
465
-
whenever you sum up large number you don’t really want to
466
-
add small quantities to big quantities.
464
+
<p><strong>Exercise:</strong> In numerical analysis, whenever you sum up large numbers you don’t really want to add small quantities to big quantities.
467
465
Bad things happen to the errors<supid="fnref:12"><ahref="#fn:12" rel="footnote">12</a></sup>.
468
466
Use this code to write a function which sums arrays of <code>double</code>.</p>
469
467
@@ -576,7 +574,7 @@ <h2>Code</h2>
576
574
* * *
577
575
</code></pre>
578
576
579
-
<p>Or as <ahref="https://en.wikipedia.org/wiki/Peter_Gustav_Lejeune_Dirichlet)">Dirichlet</a> put it: “Whether you arrange soldiers in rows or columns, you still have the same number of soldiers”.</p>
577
+
<p>Or as <ahref="https://en.wikipedia.org/wiki/Peter_Gustav_Lejeune_Dirichlet">Dirichlet</a> put it: “Whether you arrange soldiers in rows or columns, you still have the same number of soldiers”.</p>
580
578
581
579
<p>An example of an operation which is not commutative is string concatenation.</p>
582
580
@@ -640,22 +638,23 @@ <h2>Code</h2>
640
638
<ahref="https://signalvnoise.com/posts/2710-designed-by-apple-in-california">Designed in Cupertino</a>, assembled in China.
641
639
So let’s try to assemble our machine in Palo Alto.<ahref="#fnref:11" rev="footnote">↩</a></li>
642
640
<liid="fn:12">
643
-
<p>Floating point arithmetic can involve many tricky details,
644
-
but the basic issue Alex is referring to is straightforward.
645
-
We often use scientific notation to write larger numbers as a decimal to a power,
646
-
when they would otherwise be very long to write out.
647
-
For example <code>1,450,000,000 == 1.45 * 10^9</code>.
648
-
However, adding two numbers in this form can only be done accurately if they are roughly of the same power,
649
-
otherwise the larger of the two is still the best representation:
650
-
<code>1.45 * 10^9 + 1 ~= 1.45 * 10^9</code>.</p>
651
-
652
-
<p><code>float</code> and <code>double</code> have very similar limitations, and give the best results
653
-
when operations are applied to values of similar magnitudes.
654
-
To try for yourself, compare these two expressions in a program:</p>
0 commit comments