<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tim Roderick 🎈</title>
    <description>The latest articles on DEV Community by Tim Roderick 🎈 (@timroderick).</description>
    <link>https://dev.to/timroderick</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F458037%2F5ac83b28-0ca8-4955-a776-ead311158210.jpeg</url>
      <title>DEV Community: Tim Roderick 🎈</title>
      <link>https://dev.to/timroderick</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/timroderick"/>
    <language>en</language>
    <item>
      <title>What's Up With Floating Point?</title>
      <dc:creator>Tim Roderick 🎈</dc:creator>
      <pubDate>Thu, 03 Sep 2020 11:23:43 +0000</pubDate>
      <link>https://dev.to/timroderick/what-s-up-with-floating-point-o8l</link>
      <guid>https://dev.to/timroderick/what-s-up-with-floating-point-o8l</guid>
      <description>&lt;p&gt;I presume most people reading this have used floating-point numbers at &lt;em&gt;some&lt;/em&gt; point, often not intentionally.&lt;/p&gt;

&lt;p&gt;I'm also fairly sure a good number who &lt;em&gt;have&lt;/em&gt; encountered them did so after trying to discover why the result of a &lt;strong&gt;simple computation is incorrect&lt;/strong&gt;. E.G.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0.1 + 0.2
// result: 0.30000000000000004
// Which I'm fairly sure
// should be 0.3 ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The problem is that without understanding &lt;em&gt;what&lt;/em&gt; a floating-point number is, you will often find yourself frustrated when the result you expected is &lt;strong&gt;&lt;sup&gt;ever-so-slightly&lt;/sup&gt;&lt;/strong&gt; different.&lt;/p&gt;

&lt;p&gt;My goal here is to clarify &lt;strong&gt;what&lt;/strong&gt; a floating-point number is, &lt;strong&gt;why&lt;/strong&gt; we use them, and &lt;strong&gt;how&lt;/strong&gt; they work.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why do we even need floating point 🤔?
&lt;/h2&gt;

&lt;p&gt;It's not a &lt;em&gt;bold&lt;/em&gt; statement to say that computers need to store numbers. We store these numbers in binary on our phones, laptops, fridges etc.&lt;/p&gt;

&lt;p&gt;I hope that most people reading this are familiar with binary numbers in some form; if not, consider reading this blog post by &lt;a href="https://medium.com/@LindaVivah/learn-how-to-read-binary-in-5-minutes-dac1feb991e" rel="noopener noreferrer"&gt;Linda Vivah&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But what about decimal? Fractions, π, &lt;strong&gt;real numbers&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;For &lt;em&gt;any useful&lt;/em&gt; computation, we need computers to be able to represent the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Very&lt;sup&gt;very&lt;sup&gt;very&lt;sup&gt;very&lt;/sup&gt;&lt;/sup&gt;&lt;/sup&gt; &lt;strong&gt;SMALL&lt;/strong&gt; numbers,&lt;/li&gt;
&lt;li&gt;Veryveryveryvery &lt;strong&gt;BIG&lt;/strong&gt; numbers,&lt;/li&gt;
&lt;li&gt;Everything in-between!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Starting with the very&lt;sup&gt;very&lt;sup&gt;very&lt;sup&gt;very&lt;/sup&gt;&lt;/sup&gt;&lt;/sup&gt; &lt;em&gt;small&lt;/em&gt; numbers to take us in the right direction; how do we store them?&lt;/p&gt;

&lt;p&gt;Well, thats simple. We store those using the equivalent to decimal representation in binary...&lt;/p&gt;
&lt;h3&gt;
  
  
  Binary fractions
&lt;/h3&gt;

&lt;p&gt;An example should help here. Let's choose a random binary fraction: &lt;code&gt;101011.101&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe9h4qvw1y1npemr75th3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe9h4qvw1y1npemr75th3.jpg" alt="Binary Fraction Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is very similar to how decimal numbers work. The only difference is that we have base &lt;code&gt;2&lt;/code&gt; instead of base &lt;code&gt;10&lt;/code&gt;. If you chuck the above in a binary converter of your choice, you'll find that it is &lt;strong&gt;correct!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So how might we store these binary fractions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's say we allocate one byte (8 bits) to store our binary fraction: &lt;code&gt;00000000&lt;/code&gt;. We then must choose a place to put our &lt;em&gt;binary separator&lt;/em&gt; so that we can have the fractional part of our binary number.&lt;/p&gt;

&lt;p&gt;Let's try smack-bang in the middle!&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0000.0000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;What's the biggest number we can represent with this?&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1111.1111 = 15.9375
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That's... not very impressive. Neither is the smallest number we can represent, &lt;code&gt;0.00625&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There is &lt;strong&gt;a lot&lt;/strong&gt; of wasted storage space here alongside a poor range of possible numbers. The issue is that choosing any place to put our &lt;em&gt;point&lt;/em&gt; would leave us with &lt;em&gt;either&lt;/em&gt; &lt;strong&gt;fractional precision&lt;/strong&gt; &lt;em&gt;or&lt;/em&gt; a &lt;strong&gt;larger integer&lt;/strong&gt; range — not both.&lt;/p&gt;

&lt;p&gt;If we could just &lt;em&gt;move&lt;/em&gt; the fractional &lt;em&gt;point&lt;/em&gt; around as we needed, we could get so much more out of our limited storage. If only the &lt;em&gt;point&lt;/em&gt; could &lt;em&gt;float&lt;/em&gt; around as we needed it, a &lt;em&gt;floating point&lt;/em&gt; if you will...&lt;/p&gt;

&lt;p&gt;(I'm sorry, I had to 😅.)&lt;/p&gt;
&lt;h2&gt;
  
  
  So what is floating point?
&lt;/h2&gt;

&lt;p&gt;Floating point is exactly that, a &lt;em&gt;floating ( &lt;strong&gt;fractional&lt;/strong&gt; ) point&lt;/em&gt; number that gives us the ability to change the relative size of our number.&lt;/p&gt;

&lt;p&gt;So how do we mathematically represent a number in such a way that we,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;store the significant digits of the number we want to represent &lt;strong&gt;(E.G. the 12 in 0.00000012)&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;know where to put the fractional point in relation to the significant digits &lt;strong&gt;(E.G. all the 0's in 0.00000012)&lt;/strong&gt;?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To do this, let's time travel (for some) back to secondary school...&lt;/p&gt;
&lt;h3&gt;
  
  
  Standard Form (Scientific Notation)
&lt;/h3&gt;

&lt;p&gt;Anyone remember &lt;a href="https://www.mathsisfun.com/numbers/scientific-notation.html" rel="noopener noreferrer"&gt;mathsisfun&lt;/a&gt;? I somehow feel old right now but either way, this is from their website:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm2cb64rioh9rv3c6q7r2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm2cb64rioh9rv3c6q7r2.png" alt="scientific notation explanation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can do the &lt;em&gt;exact&lt;/em&gt; same thing with binary! Instead of 

&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;7∗102=7007*10^2 = 700&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;7&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;700&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, we can write&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1010111100∗20=700=10101111∗22=700
1010111100 * 2^0 = 700
\\
= 10101111 * 2^2 = 700
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1010111100&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;700&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace newline"&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;10101111&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;700&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;



&lt;p&gt;Which is equivalent to 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;175∗4=700175 * 4 = 700&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;175&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;4&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;700&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
. This is a great way to represent a number based on the &lt;em&gt;significant digits&lt;/em&gt; and the &lt;em&gt;placement of the fractional point&lt;/em&gt; relative to said digits.&lt;/p&gt;

&lt;p&gt;That's it! &lt;strong&gt;Floating point is a binary standard-form representation of numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If we want to formalise the representation a little, we need to account for positive &lt;em&gt;and&lt;/em&gt; negative numbers. To do this, we also add a sign to our number by multiplying by ±1:&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(sign)∗(significant digits)∗(base)(some power)
(\text{sign}) * (\text{significant digits}) * (\text{base})^{(\text{some power})}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;sign&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;significant digits&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;base&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mopen mtight"&gt;(&lt;/span&gt;&lt;span class="mord text mtight"&gt;&lt;span class="mord mtight"&gt;some power&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose mtight"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;And back to the example given by mathsisfun...&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;700=(1)∗(7)∗(10)2=(1)∗(10101111)∗(2)2
700 = (1) * (7) * (10)^{2}
\\
= (1) * (10101111) * (2)^{2}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;700&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;7&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;10&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace newline"&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;10101111&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mtight"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;If you are reading other literature, you'll find the representation will look something like...&lt;/p&gt;


&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;(−1)s∗c∗be
(-1)^s * c * b^{e}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;−&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mclose"&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;c&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;b&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;e&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;p&gt;Where 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;ss&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the sign bit, 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;cc&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the significand/mantissa, 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;bb&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the base, and 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;ee&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;e&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 is the exponent.&lt;/p&gt;
&lt;h2&gt;
  
  
  So why am I getting weird errors 😡?
&lt;/h2&gt;

&lt;p&gt;So, we know what floating point is now. But why can't I do something as simple as add two numbers together without the risk of error?&lt;/p&gt;

&lt;p&gt;Well the problem lies partially with the computer, but mostly with &lt;em&gt;mathematics itself&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Recurring Fractions
&lt;/h3&gt;

&lt;p&gt;Recurring fractions are an interesting problem in number representation systems.&lt;/p&gt;

&lt;p&gt;Let's choose any fraction 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;xy\frac{x}{y}&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mopen nulldelimiter"&gt;&lt;/span&gt;&lt;span class="mfrac"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="frac-line"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose nulldelimiter"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
. If 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;yy&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 has a &lt;em&gt;prime factor&lt;/em&gt; that isn't also a &lt;em&gt;factor of the base&lt;/em&gt;, it will be a recurring fraction.&lt;/p&gt;

&lt;p&gt;This is why numbers like 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1/211/21&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1/21&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 can't be represented in a finite number of digits; 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;2121&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;21&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 has 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;77&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 and 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;33&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 as prime factors, neither of which are a factor of 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1010&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/p&gt;

&lt;p&gt;Let's work through an example in decimal.&lt;/p&gt;
&lt;h4&gt;
  
  
  Decimal
&lt;/h4&gt;

&lt;p&gt;Say you want to add the numbers 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1/31/3&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1/3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 and 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;2/32/3&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;2/3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
. We all know the answer is &lt;del&gt;42&lt;/del&gt; 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;11&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, but if we are working in decimal, this isn't as obvious.&lt;/p&gt;

&lt;p&gt;This is because 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1/3=0.333333333333...1/3 = 0.333333333333...&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1/3&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.333333333333...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;It isn't a number that can be represented as a &lt;em&gt;finite&lt;/em&gt; number of digits in decimal. As we can't store infinite digits, we store an &lt;em&gt;approximation accurate to 10 places&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The calculation becomes...&lt;br&gt;

&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.3333333333+0.6666666666=0.999999999
0.3333333333+0.6666666666=0.999999999
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.3333333333&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;+&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.6666666666&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.999999999&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br&gt;
Which is definitely not 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;11&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
. It's &lt;em&gt;real&lt;/em&gt; close, but it's not 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;11&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.

&lt;p&gt;The finite nature in which we can store numbers doesn't mesh well with the inevitable fact that we &lt;em&gt;can't easily represent all numbers in a finite number of digits&lt;/em&gt;.&lt;/p&gt;
&lt;h4&gt;
  
  
  Binary
&lt;/h4&gt;

&lt;p&gt;This exact same problem occurs in binary, &lt;strong&gt;except it's even worse!&lt;/strong&gt; The reason for this is that 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;22&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 has one less prime factor than 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1010&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, namely 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;55&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/p&gt;

&lt;p&gt;Because of this, recurring fractions happen more commonly in base 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;22&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/p&gt;

&lt;p&gt;An example of this is 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;0.10.1&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0.1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
:&lt;/p&gt;

&lt;p&gt;In decimal, that's easy. In binary however... &lt;code&gt;0.00011001100110011...&lt;/code&gt;, it's another recurring fraction!&lt;/p&gt;

&lt;p&gt;So trying to perform &lt;code&gt;0.1 + 0.2&lt;/code&gt; becomes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  0.0001100110011
+ 0.0011001100110
= 0.0100110011001
= 0.299926758
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now before we got something similar to &lt;code&gt;0.30000000004&lt;/code&gt;, this is because of things like &lt;em&gt;rounding modes&lt;/em&gt; which I won't go into here (but will do so in a future post). The same principle is causing this issue.&lt;/p&gt;

&lt;p&gt;This number of errors introduced by this fact are lessened by introducing &lt;em&gt;rounding&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Precision
&lt;/h3&gt;

&lt;p&gt;The other main issue comes in the form of &lt;em&gt;precision&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;We only have a &lt;em&gt;certain number of bits&lt;/em&gt; dedicated to the significant digits of our floating point number.&lt;/p&gt;

&lt;h4&gt;
  
  
  Decimal
&lt;/h4&gt;

&lt;p&gt;As an example, consider we have three &lt;em&gt;decimal&lt;/em&gt; values to store our significant digits.&lt;/p&gt;

&lt;p&gt;If we compare 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;333333&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;333&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 and 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1/3∗1031/3 * 10^3&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1/3&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, we would find that in our system they are the &lt;em&gt;exact same&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is because we only have three values of precision to store the significant digits of our number, and that involves truncating the end off of our recurring fraction.&lt;/p&gt;

&lt;p&gt;In an extreme example, adding 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;11&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 to 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1∗1031*10^3&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 will result in 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;1∗1031*10^3&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;∗&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
, the number &lt;em&gt;hasn't changed&lt;/em&gt;. This is because you need &lt;em&gt;four&lt;/em&gt; significant digits to represent 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;10011001&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1001&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/p&gt;

&lt;h4&gt;
  
  
  Binary
&lt;/h4&gt;

&lt;p&gt;This exact same issue occurs in binary with very&lt;sup&gt;very&lt;sup&gt;very&lt;sup&gt;very&lt;/sup&gt;&lt;/sup&gt;&lt;/sup&gt; &lt;em&gt;small&lt;/em&gt; and veryveryveryvery &lt;em&gt;big&lt;/em&gt; numbers. In a future post I will be talking more about the limits of floating point.&lt;/p&gt;

&lt;p&gt;For completeness, consider the previous example in binary, where we now have 3 &lt;em&gt;bits&lt;/em&gt; to represent our significant digits.&lt;/p&gt;

&lt;p&gt;By using base 2 instead, &lt;code&gt;1 * 2^3&lt;/code&gt;, adding &lt;code&gt;1&lt;/code&gt; to our number will result in no change. This is because to represent &lt;code&gt;1001&lt;/code&gt; (now equivalent to 9 in decimal) requires 4 bits, the &lt;em&gt;less significant&lt;/em&gt; binary digits are &lt;em&gt;lost in translation&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;There is no solution here, the limits of precision are defined by the amount we can store. To get around this, use a larger floating point data type.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;E.G.&lt;/strong&gt; move from a &lt;em&gt;single&lt;/em&gt;-precision floating-point number to a &lt;em&gt;double&lt;/em&gt;-precision floating-point number.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;h3&gt;
  
  
  TLDR
&lt;/h3&gt;

&lt;p&gt;To bring it all together, floating-point numbers are a representation of binary values akin to &lt;a href="https://www.mathsisfun.com/numbers/scientific-notation.html" rel="noopener noreferrer"&gt;&lt;em&gt;standard-form&lt;/em&gt; or &lt;em&gt;scientific notation&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It allows us to store &lt;strong&gt;BIG&lt;/strong&gt; and &lt;strong&gt;small&lt;/strong&gt; numbers with precision.&lt;/p&gt;

&lt;p&gt;To do this we move the &lt;em&gt;fractional point&lt;/em&gt; relative to the significant digits of the number to make that number bigger or smaller at a rate proportional to the base being used.&lt;/p&gt;

&lt;p&gt;Most of the &lt;strong&gt;errors&lt;/strong&gt; associated with floating point come in the form of representing &lt;em&gt;recurring fractions&lt;/em&gt; in a &lt;em&gt;finite&lt;/em&gt; number of bits. Rounding modes help to reduce these errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks 🥰!
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Thank you so much for reading!&lt;/strong&gt; I hope this was helpful to those that needed a little refresher on floating point and also to those that are new to this concept.&lt;/p&gt;

&lt;p&gt;I will be making one or two updates to this post explaining the in-depths of the &lt;a href="https://en.wikipedia.org/wiki/IEEE_754" rel="noopener noreferrer"&gt;IEEE 754-2008 Floating Point Standard&lt;/a&gt;, so if you have questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What are the biggest and smallest numbers I can use in floating point?"&lt;/li&gt;
&lt;li&gt;"What do financial institutions do about these errors?&lt;/li&gt;
&lt;li&gt;"Can we use other bases?"&lt;/li&gt;
&lt;li&gt;"How do we &lt;em&gt;actually&lt;/em&gt; perform floating-point arithmetic?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then feel free to follow to see an update! You can also follow me on twitter &lt;a href="https://twitter.com/tim_cb_roderick" rel="noopener noreferrer"&gt;@tim_cb_roderick&lt;/a&gt; for updates.If you have any questions please feel free to leave a comment below.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Key Topics from my Computer Science &amp; Maths Degree - Transcript Review</title>
      <dc:creator>Tim Roderick 🎈</dc:creator>
      <pubDate>Thu, 27 Aug 2020 22:52:53 +0000</pubDate>
      <link>https://dev.to/timroderick/key-topics-from-my-computer-science-maths-degree-transcript-review-54j2</link>
      <guid>https://dev.to/timroderick/key-topics-from-my-computer-science-maths-degree-transcript-review-54j2</guid>
      <description>&lt;p&gt;After four years, I've finally finished my degree 🎉. Since then, I've been thinking about how I developed personally over that time.&lt;/p&gt;

&lt;p&gt;This post will aim to highlight the &lt;em&gt;structure&lt;/em&gt; and &lt;em&gt;key topics&lt;/em&gt; from my degree. Hopefully this will be able to help you decide on some direction to take during your personal development.&lt;/p&gt;

&lt;p&gt;I'll sprinkle a few tips throughout 💖.&lt;/p&gt;

&lt;p&gt;Already familiar with most of these concepts? Maybe look at a few topics you've dodged until now!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;*DISCLAIMER*&lt;/strong&gt; This is my personal experience, I'm not suggesting this is the &lt;em&gt;correct&lt;/em&gt; order or way to learn these concepts. People will learn more/less in a greater breadth/depth, it's &lt;em&gt;personal preference&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  First Year
&lt;/h2&gt;

&lt;p&gt;This is how I've described this year to others in the past:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Attack of the concepts 📚.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We were subject to a large number of introductory courses. Taking the time to let this stuff sink in was important long-term.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to program 👩‍💻
&lt;/h3&gt;

&lt;p&gt;On the CS side, the year mostly consisted of teaching us how to code in &lt;strong&gt;C&lt;/strong&gt; , &lt;strong&gt;Java&lt;/strong&gt; , and &lt;strong&gt;Haskell&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C&lt;/strong&gt; was used to help us understand the lower level aspect of development: how memory is allocated and how pointers work.&lt;/p&gt;

&lt;p&gt;After this we learned how to think about programming &lt;em&gt;functionally&lt;/em&gt; using &lt;strong&gt;Haskell&lt;/strong&gt;. This felt unnecessary at the time, but it proved incredibly useful for helping me build an intuition for algorithmic complexity.&lt;/p&gt;

&lt;p&gt;Finally, &lt;strong&gt;Java&lt;/strong&gt; was used to teach us object oriented programming. Since this is likely the majority of programming a developer will be doing, it is vital to take time to understand OOP principles and design patterns.&lt;/p&gt;

&lt;p&gt;If you are looking for a good introductory resource to programming, I love &lt;a href="https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw"&gt;Daniel Shiffman's beginner friendly YouTube channel&lt;/a&gt; as a starting resource.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2VLaIr5Ckbs"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture 👷‍♂️
&lt;/h3&gt;

&lt;p&gt;Introduction to Computer Architecture to me was the &lt;em&gt;most important unit&lt;/em&gt;. We aren't programming infinitely complex theoretical boxes as developers, we are using &lt;em&gt;finitely complex machines&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This unit explored computer hardware from &lt;em&gt;silicon to stack&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;After learning how to program, this unit helped all the pieces fall into place. It was the first big &lt;a href="https://en.wikipedia.org/wiki/Eureka_effect"&gt;eureka moment&lt;/a&gt; for me as a beginner.&lt;/p&gt;

&lt;p&gt;I would highly recommend &lt;a href="https://safari.ethz.ch/digitaltechnik/spring2018/doku.php?id=schedule"&gt;Prof. Onur Mutlu from ETH Zurich's excellent lecture series on computer architecture&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PMJxcArLU1E"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Necessary Mathematics 🧮
&lt;/h3&gt;

&lt;p&gt;As a developer, you won't get very far if you avoid maths altogether. So embrace it! Also embrace that there is often &lt;em&gt;100+ years of previous academic research&lt;/em&gt; - it's taken people a while to get this stuff.&lt;/p&gt;

&lt;p&gt;Look up concepts as and when you need them, taking time to let them sink in. Filling in these spooky-ghost-shaped holes in your knowledge will always help in the long run.&lt;/p&gt;

&lt;p&gt;You won't become an expert overnight and mathematics is notorious for its lack of a helping-hand, but &lt;em&gt;you can do it!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Depending on where you want to go with your development, you will need to know different topics. I focused on statistics and machine learning so, for me, the most essential were &lt;strong&gt;Linear Algebra&lt;/strong&gt; and &lt;strong&gt;Probability Theory&lt;/strong&gt; initially.&lt;/p&gt;

&lt;h3&gt;
  
  
  Notable Mentions 🥉
&lt;/h3&gt;

&lt;p&gt;Theory of computation was a unit dedicated to the fundamental mathematical properties of computing: &lt;em&gt;what can and cannot be computed&lt;/em&gt;. Useful IMO. I found these &lt;a href="https://www.cs.toronto.edu/~jcook/csc240/w2020/texts/b36_236_240_notes.pdf"&gt;course notes by Vassos Hadzilacos&lt;/a&gt; that may be a good read if you're interested.&lt;/p&gt;

&lt;h2&gt;
  
  
  Second Year
&lt;/h2&gt;

&lt;p&gt;For me, this year was a big motivational bounce-back from the first. It's the move from everything being &lt;em&gt;new&lt;/em&gt; and &lt;em&gt;tiring&lt;/em&gt; to everything being &lt;em&gt;familiar&lt;/em&gt; and &lt;em&gt;challenging&lt;/em&gt;. You start to focus in on topics you have knowledge of now and the details start to flow.&lt;/p&gt;

&lt;p&gt;My stand-out units from this year all follow this pattern.&lt;/p&gt;

&lt;h3&gt;
  
  
  Applying New Skills ✨
&lt;/h3&gt;

&lt;p&gt;You know how to write some code ideally by this point (I &lt;em&gt;thought&lt;/em&gt; I did 😅). The problem was applying myself to problems that were not &lt;em&gt;designed&lt;/em&gt; to educate me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Structures and Algorithms&lt;/strong&gt; was an important unit all about understanding computational complexity. It was the step from writing code that &lt;em&gt;worked&lt;/em&gt; to code that &lt;em&gt;worked efficiently&lt;/em&gt;. Dynamic programming was a concept I learned here that I now use regularly. Here's a course &lt;a href="https://www.cs.bham.ac.uk/~jxb/DSA/dsa.pdf"&gt;PDF I found by John Bullinaria on DSA&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symbols, Patterns and Signals&lt;/strong&gt; covered how we digitally interpret the world around us. This was achieved through examples from applications in computer vision, audio, and machine learning.&lt;/p&gt;

&lt;p&gt;This topic is broad so some searchable highlights from this unit might be &lt;em&gt;"K-means clustering"&lt;/em&gt;, &lt;em&gt;"The Fourier Transform"&lt;/em&gt;, &lt;em&gt;"Audio sampling"&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Databases and Cloud Concepts&lt;/strong&gt; was also taught in my second year, although it was intended to be taught to us in first year. If you tackled this one earlier that would probably make sense. This unit was all about &lt;em&gt;web security&lt;/em&gt;, how the &lt;em&gt;internet&lt;/em&gt; works, and &lt;em&gt;SQL&lt;/em&gt;. &lt;a href="https://roadmap.sh/frontend/resources"&gt;Roadmap.sh&lt;/a&gt; has a list of resources for learning key concepts with context.&lt;/p&gt;

&lt;p&gt;Here's a great video from &lt;a href="https://twitter.com/3blue1brown"&gt;@3blue1brown&lt;/a&gt; about the fourier transform:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/spUNpyF58BY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Useful Mathematics 🎲
&lt;/h3&gt;

&lt;p&gt;The fundamentals mathematics learnt so far will be enough to keep most developers afloat for the forseeable future. Further reading at this level is still important however.&lt;/p&gt;

&lt;p&gt;From the &lt;strong&gt;Combinatorics&lt;/strong&gt; unit I got a much greater understanding of discrete mathematics, including &lt;em&gt;graphs&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Internships 💻
&lt;/h3&gt;

&lt;p&gt;So this is the year I also got my first internship over the summer. If I had to replace the internship, I would self-study what I learnt on the job: &lt;em&gt;C++&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But &lt;em&gt;C++&lt;/em&gt; is one of many programming languages / tools used commonly in industry. Looking into &lt;strong&gt;what tools are used in your ideal line of work&lt;/strong&gt; is a great step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Third Year
&lt;/h2&gt;

&lt;p&gt;This year was all about taking the &lt;em&gt;conceptual&lt;/em&gt; understanding of a variety of topics and churning it into &lt;em&gt;rigorous&lt;/em&gt; understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refining 🔨
&lt;/h3&gt;

&lt;p&gt;These units are all natural extensions of topics learnt from the first two years:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Machine Learning:&lt;/strong&gt; Linear regression, Gaussian Processes, Unsupervised Learning ...&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Processing and Computer Vision:&lt;/strong&gt; Computer Vision algorithms and a bit about Deep Learning. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Technologies:&lt;/strong&gt; How to build a web app; &lt;em&gt;CSS, HTML, Javascript&lt;/em&gt;;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I found &lt;a href="https://www.technotification.com/2019/02/websites-to-learn-machine-learning.html"&gt;this blog post&lt;/a&gt; that lists several free online courses for ML. For deep learning, &lt;a href="https://www.fast.ai/"&gt;fast.ai&lt;/a&gt; have practical courses. For web technologies, again &lt;a href="https://roadmap.sh/frontend/resources"&gt;Roadmap.sh&lt;/a&gt; has a list of resources for learning key concepts with context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Communicating Science 💬
&lt;/h3&gt;

&lt;p&gt;A skill that is necessary for any developer is your ability to communicate ideas.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't have to be a public speaker or a poet.&lt;/p&gt;

&lt;p&gt;Don't need to show it in fear of blowing it.&lt;/p&gt;

&lt;p&gt;Meek creature; Word weaver.&lt;/p&gt;

&lt;p&gt;Chat clearer, not to feature.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Seriously, you do need to be able to communicate your thoughts to your peers and colleagues.&lt;/p&gt;

&lt;p&gt;This was the year I did my first serious academic project, which for further reading can be found &lt;a href="https://tim-roderick.github.io/methods_for_generating_road_networks/"&gt;here&lt;/a&gt;. This helped instil some of the key concepts needed for communicating ideas.&lt;/p&gt;

&lt;p&gt;As a replacement, this would be a point in your development to start writing blog posts or other long form explanations of concepts. I like this thread I saw on twitter with some ideas of where to start:&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--kGwch0Fv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1276691437711552512/n6VxRfyG_normal.jpg" alt="Randall Kanna profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Randall Kanna
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/randallkanna"&gt;@randallkanna&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P4t6ys1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      A few ideas for your very first dev blog post. 🧵&lt;br&gt;&lt;br&gt;What are some other good post ideas that you would recommend to a developer?
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      19:59 PM - 24 Aug 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1297987036914180096" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1297987036914180096" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      50
      &lt;a href="https://twitter.com/intent/like?tweet_id=1297987036914180096" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      292
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Fourth Year
&lt;/h2&gt;

&lt;p&gt;From &lt;em&gt;common knowledge&lt;/em&gt; to &lt;em&gt;state-of-the-art&lt;/em&gt;. The move from understanding topics in reasonable depth to understanding the &lt;strong&gt;bleeding-edge&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Specialisation 🎓
&lt;/h3&gt;

&lt;p&gt;The units I took this year describe my specialisation as an academic through a focused set of related subjects.&lt;/p&gt;

&lt;p&gt;The following subjects give a good view into my choice of specialisation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.fast.ai/topics/"&gt;Applied Data Science&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fast.ai/"&gt;Applied Deep Learning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Anomaly_detection"&gt;Anomaly Detection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.unige.ch/sciences/astro/files/2713/8971/4086/3_Paltani_MonteCarlo.pdf"&gt;Monte Carlo Methods&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These subjects are related through statistics, machine learning and data science.&lt;/p&gt;

&lt;p&gt;At this point in your personal development you may want to find the topics you &lt;em&gt;really enjoy&lt;/em&gt; and delve deep into them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Project 🥳
&lt;/h3&gt;

&lt;p&gt;My Masters Thesis was on utilising the popular &lt;a href="https://ai.googleblog.com/2017/08/transformer-novel-neural-network.html"&gt;Transformer&lt;/a&gt; architecture for video summarisation. Key point:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It was the most work I've put into anything in my life.&lt;/li&gt;
&lt;li&gt;It wasn't successful.&lt;/li&gt;
&lt;li&gt;It was fun!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I think this will describe a fair amount of work done at this point in a persons development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;That covers most of the subjects I took over four years at university! If people want anymore detail on specific subjects then feel free to tweet me &lt;a href="https://twitter.com/tim_cb_roderick"&gt;@tim_cb_roderick&lt;/a&gt; or leave a comment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Takeaway
&lt;/h3&gt;

&lt;p&gt;Your personal development journey is unique and challenging. By highlighting the steps I took during my education, I hope I can bring clarity and guidance to those looking for it.&lt;/p&gt;

&lt;p&gt;The way I learnt &lt;em&gt;certainly isn't the only way&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You may choose to delve deep into certain topics and keep your focus there. You could skip all things hardware and focus purely on the software.&lt;/p&gt;

&lt;p&gt;In the end that isn't the key takeaway from this review. For me, it's that learning is a long process that takes time. Rushing it will only hurt your confidence and abilities in the long run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;p&gt;I hope I've provided enough resources throughout this post to help guide people if they are interested. If you have any specific queries feel free ask, &lt;strong&gt;I'll try my best!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most of the maths modules I've mentioned so far can be found as free courses on &lt;a href="https://www.khanacademy.org/math"&gt;Khan Academy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A great set of CS courses covering a larger number of topics mentioned in this post can be found at &lt;a href="https://www.freecodecamp.org/"&gt;freeCodeCamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>career</category>
      <category>computerscience</category>
      <category>university</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
