<?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: Novatus</title>
    <description>The latest articles on DEV Community by Novatus (@novatus).</description>
    <link>https://dev.to/novatus</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4275633%2F3c64e850-a253-47a4-8ba6-09774cb394cb.png</url>
      <title>DEV Community: Novatus</title>
      <link>https://dev.to/novatus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/novatus"/>
    <language>en</language>
    <item>
      <title>Based floating-point number in Erlang, a small intro</title>
      <dc:creator>Novatus</dc:creator>
      <pubDate>Fri, 04 Dec 2026 15:12:37 +0000</pubDate>
      <link>https://dev.to/novatus/based-floating-point-number-in-erlang-a-small-intro-222</link>
      <guid>https://dev.to/novatus/based-floating-point-number-in-erlang-a-small-intro-222</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assumptions&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You must have read &lt;a href="https://dev.to/novatus/writing-some-tough-numbers-a3i"&gt;previous article&lt;/a&gt; related to &lt;code&gt;base#digits&lt;/code&gt; syntax in Erlang.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a short expansion on that article. Adding little more complexity to your knowledge ! It's fine even if you dont understand it just practice the examples below and that's all you need. &lt;/p&gt;

&lt;p&gt;Now lets say you want to write &lt;strong&gt;Dyadic rationals&lt;/strong&gt; (also called &lt;strong&gt;binary rationals&lt;/strong&gt;) in Erlang. The way to do it is by writing &lt;em&gt;floating-point numbers&lt;/em&gt;. It is a type of data (&lt;em&gt;data type&lt;/em&gt;) in Erlang or more technically saying they are "&lt;strong&gt;IEEE 754 binary64 (double-precision)&lt;/strong&gt; floating-point values".&lt;/p&gt;

&lt;p&gt;The syntax to write it is as follows:&lt;/p&gt;

&lt;p&gt;"&lt;code&gt;base&lt;/code&gt; &lt;code&gt;#&lt;/code&gt; &lt;code&gt;digits&lt;/code&gt; &lt;code&gt;.&lt;/code&gt; &lt;code&gt;digits&lt;/code&gt; &lt;code&gt;#e&lt;/code&gt; &lt;code&gt;exponent&lt;/code&gt;"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is syntax for &lt;strong&gt;base-prefixed floating-point number&lt;/strong&gt; (a "based float") with a decimal exponent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Structure of the number
&lt;/h2&gt;

&lt;p&gt;A number of this form has four parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;base&lt;/code&gt;:&lt;/strong&gt; A decimal integer from &lt;code&gt;2&lt;/code&gt; through &lt;code&gt;36&lt;/code&gt; specifying the numeral base for the integer and fractional digit parts (&lt;em&gt;for example, &lt;code&gt;2&lt;/code&gt; for binary or &lt;code&gt;16&lt;/code&gt; for hexadecimal&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;digits.digits&lt;/code&gt;:&lt;/strong&gt; The integer part before &lt;code&gt;.&lt;/code&gt; and the fractional part after &lt;code&gt;.&lt;/code&gt;, written using digits valid for &lt;code&gt;base&lt;/code&gt; (&lt;em&gt;&lt;code&gt;0-9&lt;/code&gt; and letters &lt;code&gt;A-Z&lt;/code&gt; / &lt;code&gt;a-z&lt;/code&gt; up to &lt;code&gt;base - 1&lt;/code&gt;&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;#e&lt;/code&gt; (or &lt;code&gt;#E&lt;/code&gt;):&lt;/strong&gt; The separator that introduces the exponent part.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;exponent&lt;/code&gt;:&lt;/strong&gt; A &lt;strong&gt;decimal&lt;/strong&gt; (base-10) signed or unsigned integer (&lt;em&gt;for example, &lt;code&gt;+6&lt;/code&gt;, &lt;code&gt;-3&lt;/code&gt;, or &lt;code&gt;4&lt;/code&gt;&lt;/em&gt;). that scales the value by $\text{base}^{\text{exponent}}$.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  How the Value Is Evaluated
&lt;/h2&gt;

&lt;p&gt;For a number &lt;code&gt;B#I.F#eE&lt;/code&gt;, the mathematical value before rounding to IEEE 754 &lt;code&gt;binary64&lt;/code&gt; is:&lt;/p&gt;

&lt;p&gt;$$\left(I + \frac{F}{B^k}\right) \times B^E$$&lt;/p&gt;

&lt;p&gt;where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;$B$ is &lt;code&gt;base&lt;/code&gt; (in decimal),&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;$I$ is the value of the integer digits before &lt;code&gt;.&lt;/code&gt; in base $B$,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;$F$ is the value of the fractional digits after &lt;code&gt;.&lt;/code&gt; in base $B$,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;$k$ is the number of fractional digits after &lt;code&gt;.&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;$E$ is the decimal integer &lt;code&gt;exponent&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  An Example (&lt;code&gt;16#ff.fe#e+6&lt;/code&gt;)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Base ($B$):&lt;/strong&gt; &lt;code&gt;16&lt;/code&gt; (hexadecimal).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integer part (&lt;code&gt;ff&lt;/code&gt;):&lt;/strong&gt; $15 \times 16^1 + 15 \times 16^0 = 255$.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Fractional part (&lt;code&gt;.fe&lt;/code&gt;, $k = 2$ hex digits):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;$$\frac{15 \times 16^1 + 14 \times 16^0}{16^2} = \frac{254}{256} = 0.9921875$$&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Significand before scaling:&lt;/strong&gt; $255 + \frac{254}{256} = 255.9921875$.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Exponent scaling (&lt;code&gt;#e+6&lt;/code&gt;):&lt;/strong&gt; Multiplies by $16^{+6}$ (decimal exponent &lt;code&gt;6&lt;/code&gt;), yielding:&lt;/p&gt;

&lt;p&gt;$$255.9921875 \times 16^6 = 4{,}294{,}950{,}912.0$$&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Few more examples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Number&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Base (B)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Integer Part (I)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Fractional Part (F, k digits)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Decimal Exponent (E)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Formula: (I+F/Bk)×BE&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Resulting Erlang float Value&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;16#ff.fe#e+6&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ff&lt;/code&gt; ($255$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;fe&lt;/code&gt; ($254$, $k=2$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;+6&lt;/code&gt; ($6$)&lt;/td&gt;
&lt;td&gt;$(255 + 254 / 16^2) \times 16^6$&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;4.294950912e9&lt;/code&gt; ($4{,}294{,}950{,}912.0$)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;2#1.1#e+0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;1&lt;/code&gt; ($1$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;1&lt;/code&gt; ($1$, $k=1$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;+0&lt;/code&gt; ($0$)&lt;/td&gt;
&lt;td&gt;$(1 + 1 / 2^1) \times 2^0$&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1.5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;2#101.01#e+2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;101&lt;/code&gt; ($5$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;01&lt;/code&gt; ($1$, $k=2$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;+2&lt;/code&gt; ($2$)&lt;/td&gt;
&lt;td&gt;$(5 + 1 / 2^2) \times 2^2$&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;21.0&lt;/code&gt; ($5.25 \times 4$)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;16#1.8#e-1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;1&lt;/code&gt; ($1$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;8&lt;/code&gt; ($8$, $k=1$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;-1&lt;/code&gt; ($-1$)&lt;/td&gt;
&lt;td&gt;$(1 + 8 / 16^1) \times 16^{-1}$&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0.09375&lt;/code&gt; ($1.5 / 16$)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;8#10.4#e+1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;10&lt;/code&gt; ($8$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;4&lt;/code&gt; ($4$, $k=1$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;+1&lt;/code&gt; ($1$)&lt;/td&gt;
&lt;td&gt;$(8 + 4 / 8^1) \times 8^1$&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;68.0&lt;/code&gt; ($8.5 \times 8$)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;36#a.0#e+0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;36&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;a&lt;/code&gt; ($10$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; ($0$, $k=1$)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;+0&lt;/code&gt; ($0$)&lt;/td&gt;
&lt;td&gt;$(10 + 0 / 36^1) \times 36^0$&lt;/td&gt;
&lt;td&gt;&lt;code&gt;10.0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Practice in your terminal
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;1&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 16#ff.fe#e+6. 
4294836224.0 
2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2#101.01#e+2. 
21.0 
3&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>erlang</category>
    </item>
    <item>
      <title>Writing some tough numbers</title>
      <dc:creator>Novatus</dc:creator>
      <pubDate>Fri, 04 Dec 2026 14:46:30 +0000</pubDate>
      <link>https://dev.to/novatus/writing-some-tough-numbers-a3i</link>
      <guid>https://dev.to/novatus/writing-some-tough-numbers-a3i</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assumptions&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You had read previous article on &lt;a href="https://dev.to/novatus/numbers-as-your-very-first-thing-in-erlang-3p6j"&gt;numbers&lt;/a&gt; in Erlang.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;p&gt;Now as you know what &lt;em&gt;Erlang integers&lt;/em&gt; are and how they are written as well as how they correspond to &lt;em&gt;mathematical integers&lt;/em&gt;, we will go forward from here.&lt;/p&gt;

&lt;p&gt;I hope you are familiar with &lt;em&gt;Positional numeral systems (place value &amp;amp; radix)&lt;/em&gt; in mathematics. If not then revise that chapter from your school's maths textbooks.&lt;/p&gt;

&lt;p&gt;Let's now write our integers in custom radix. To do that in Erlang we have a simple syntax &lt;code&gt;base#digits&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How the Two Parts Work ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;base&lt;/code&gt;&lt;/strong&gt;: A mathematical integer (&lt;em&gt;in decimal number system&lt;/em&gt;) from &lt;code&gt;2&lt;/code&gt; through &lt;code&gt;36&lt;/code&gt; specifying the number base (&lt;em&gt;for example, &lt;code&gt;2&lt;/code&gt; for binary, &lt;code&gt;8&lt;/code&gt; for octal, &lt;code&gt;16&lt;/code&gt; for hexadecimal, or &lt;code&gt;36&lt;/code&gt; for base-36&lt;/em&gt;). Outside this range (&lt;em&gt;&lt;code&gt;1&lt;/code&gt;, &lt;code&gt;37&lt;/code&gt;, negative numbers, or non-integers&lt;/em&gt;), it gets rejected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;digits&lt;/code&gt;&lt;/strong&gt;:  One or more characters representing the value in that base. The characters are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mathematical Digits &lt;code&gt;0-9&lt;/code&gt;:&lt;/strong&gt; Represent values &lt;code&gt;0&lt;/code&gt; through &lt;code&gt;9&lt;/code&gt; (where available in the chosen base). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letters &lt;code&gt;A-Z&lt;/code&gt; (or &lt;code&gt;a-z&lt;/code&gt;):&lt;/strong&gt; Represent values &lt;code&gt;10&lt;/code&gt; through &lt;code&gt;35&lt;/code&gt; (&lt;code&gt;A&lt;/code&gt;/&lt;code&gt;a&lt;/code&gt; = &lt;code&gt;10&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;/&lt;code&gt;b&lt;/code&gt; = &lt;code&gt;11&lt;/code&gt;, ..., &lt;code&gt;Z&lt;/code&gt;/&lt;code&gt;z&lt;/code&gt; = &lt;code&gt;35&lt;/code&gt;). Case does not change the numeric value.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are going to write few integers using this syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;1&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2#1101. 
13 
2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 8#77. 
63 
3&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 16#1a. 
26 
4&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also put a leading &lt;code&gt;-&lt;/code&gt; or &lt;code&gt;+&lt;/code&gt; before &lt;code&gt;base#digits&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Below it the table of results plus some extras.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Erlang Integers&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Base&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Digits Used&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Decimal Value&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;2#1101&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2 (binary)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;13&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;8#77&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;8 (octal)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0-7&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;63&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;16#1a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;16 (hex)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0-9&lt;/code&gt;, &lt;code&gt;a-f&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;26&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;16#1A&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;16 (hex)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0-9&lt;/code&gt;, &lt;code&gt;A-F&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;26&lt;/code&gt; (same as &lt;code&gt;16#1a&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;36#Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;36 (base-36)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0-9&lt;/code&gt;, &lt;code&gt;A-Z&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;35&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;36#10&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;36 (base-36)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0-9&lt;/code&gt;, &lt;code&gt;A-Z&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;36&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-16#FF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;16 (hex, negative)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0-9&lt;/code&gt;, &lt;code&gt;A-F&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;-255&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;What if &lt;code&gt;base&lt;/code&gt; goes outside the range ?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;4&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 1#12. 
&lt;span class="c"&gt;#12. &lt;/span&gt;
* 1:1: illegal base &lt;span class="s1"&gt;'1'&lt;/span&gt; 
4&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 45#98678. 
&lt;span class="c"&gt;#98678. &lt;/span&gt;
* 1:1: illegal base &lt;span class="s1"&gt;'45'&lt;/span&gt; 
4&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Erlang rejects it.&lt;/p&gt;

&lt;p&gt;As seen above the &lt;code&gt;base#digits&lt;/code&gt; syntax is quite useful. The &lt;code&gt;base#digits&lt;/code&gt; syntax lets you write integers directly in &lt;strong&gt;non-decimal bases&lt;/strong&gt; such as &lt;code&gt;2&lt;/code&gt;, &lt;code&gt;8&lt;/code&gt;, &lt;code&gt;16&lt;/code&gt;, etc.&lt;/p&gt;

</description>
      <category>erlang</category>
    </item>
    <item>
      <title>Numbers as your very first thing in Erlang</title>
      <dc:creator>Novatus</dc:creator>
      <pubDate>Fri, 04 Dec 2026 14:09:32 +0000</pubDate>
      <link>https://dev.to/novatus/numbers-as-your-very-first-thing-in-erlang-3p6j</link>
      <guid>https://dev.to/novatus/numbers-as-your-very-first-thing-in-erlang-3p6j</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assumptions&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Erlang is already installed on your computer.&lt;/li&gt;
&lt;li&gt;You can call Erlang shell by typing &lt;code&gt;erl&lt;/code&gt; in your terminal.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;p&gt;Welcome !&lt;/p&gt;

&lt;p&gt;This is where you start with the amazing programming language Erlang. The very first thing to begin with shall always be simple, minimal, atomic and foundational. Thus we are starting Erlang with the &lt;strong&gt;numbers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You must be familiar with typical numbers in mathematics i.e. &lt;em&gt;natural, whole, integers, rational, irrational, real and complex&lt;/em&gt; numbers. Erlang also have a way to represent the numbers. We are slowly and gradually going to cover it all in this article.&lt;/p&gt;

&lt;p&gt;Let's start with integers (&lt;em&gt;integers in Erlang language&lt;/em&gt;).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What are Erlang integers ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Erlang integers correspond to &lt;strong&gt;mathematical integers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Integer is numeric &lt;strong&gt;data type&lt;/strong&gt; (&lt;em&gt;type of a data&lt;/em&gt;) in Erlang.&lt;/li&gt;
&lt;li&gt;Integers are way to represent your numerical values (&lt;em&gt;or technically saying: numeric data&lt;/em&gt;), especially the mathematical integers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, open your terminal and type &lt;code&gt;erl&lt;/code&gt; and press &lt;strong&gt;enter&lt;/strong&gt;. The "Erlang shell" will open and from here we go forward. Type your favorite mathematical integer and then a dot &lt;code&gt;.&lt;/code&gt; . I will go with my favorite.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1&amp;gt; 1000. 
1000 
2&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See, you got your favorite mathematical integer back on the screen !&lt;/p&gt;

&lt;p&gt;Now lets say you want to see a negative mathematical integer on screen, so here it is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1&amp;gt; -525. 
-525 
2&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see Erlang can represent the negative integers too.&lt;/p&gt;

&lt;p&gt;Few more examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1&amp;gt; 09437. 
9437 
2&amp;gt; -0947. 
-947 
3&amp;gt; -0000018. 
-18 
4&amp;gt; 00009789. 
9789 
5&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you had noticed the leading zeroes are trimmed !&lt;/p&gt;

&lt;p&gt;That's your first chapter. See you in the next one.&lt;/p&gt;

</description>
      <category>erlang</category>
    </item>
  </channel>
</rss>
