<?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>Forem: Pooja Pawar</title>
    <description>The latest articles on Forem by Pooja Pawar (@pooja_pawar_26873450cc628).</description>
    <link>https://forem.com/pooja_pawar_26873450cc628</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%2F3564404%2F9f7e51eb-48cd-401d-8715-fd5e8d0bc5a4.jpg</url>
      <title>Forem: Pooja Pawar</title>
      <link>https://forem.com/pooja_pawar_26873450cc628</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pooja_pawar_26873450cc628"/>
    <language>en</language>
    <item>
      <title>How Does JavaScript Handle Numbers in Memory?</title>
      <dc:creator>Pooja Pawar</dc:creator>
      <pubDate>Tue, 14 Oct 2025 12:27:49 +0000</pubDate>
      <link>https://forem.com/pooja_pawar_26873450cc628/how-does-javascript-handle-numbers-in-memory-358</link>
      <guid>https://forem.com/pooja_pawar_26873450cc628/how-does-javascript-handle-numbers-in-memory-358</guid>
      <description>&lt;p&gt;Every number in JavaScript allocates 8 bytes of memory. Whether you type 5, -100, or 3.14159 it will allocate 8 byte of memory&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fglruyzsvq91t5ro299s8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fglruyzsvq91t5ro299s8.png" alt=" " width="396" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore JavaScript stores a number in 64 boxes&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftngr87jh6g4yv838sr7i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftngr87jh6g4yv838sr7i.png" alt=" " width="667" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These 64 bits are divided into three sections&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign (s)&lt;/li&gt;
&lt;li&gt;Exponent (e)&lt;/li&gt;
&lt;li&gt;Mantissa (m) 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foj1b7035f87vg5h9z09x.png" alt=" " width="725" height="367"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Let's take an example.&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;let a = 10;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step1 :&lt;/strong&gt; Convert the no into the binary format&lt;br&gt;
 &lt;strong&gt;10 = 1010&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step2 :&lt;/strong&gt; Normalized form &lt;br&gt;
    1. we can write &lt;strong&gt;1010 as 1010.0&lt;/strong&gt; as we write 10 as 10.0 in decimal &lt;br&gt;
    2. The rule for the IEEE 754 format is to move the binary point until      there is only one '1' to the left of it so it becomes &lt;strong&gt;1.010&lt;/strong&gt;&lt;br&gt;
    3. Since we moved the point 3 places to the left, the original number is equal to 1.010 multiplied by 2^3&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gse7to2lcm8g3y0978j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gse7to2lcm8g3y0978j.png" alt=" " width="437" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This normalized form gives us the three components we need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign: if the number is negative sign= 1 and if the number is positive then the sign= 0&lt;/li&gt;
&lt;li&gt;Exponent: The power of 2 is 3.&lt;/li&gt;
&lt;li&gt;Mantissa (Significand): The digits after the binary point are 010.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step3 :&lt;/strong&gt; Determine the 64-Bit Components&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Since 10 is a positive number, the single sign bit is 0.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The exponent field stores the actual power (3 in this case) plus a fixed number called the bias. The bias for the 64-bit format is 1023 &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbyx0jlfpe0fntybmfox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbyx0jlfpe0fntybmfox.png" alt=" " width="403" height="108"&gt;&lt;/a&gt;&lt;br&gt;
1026 is converted to its 11-bit binary form:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02puxqwhqev8j5sivjpu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02puxqwhqev8j5sivjpu.png" alt=" " width="303" height="56"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.The mantissa is 010 Since the mantissa field has 52 bits&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyn4cg7a8i85djr557of.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyn4cg7a8i85djr557of.png" alt=" " width="398" height="90"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjq1sdcnagiu1fn9nyly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjq1sdcnagiu1fn9nyly.png" alt=" " width="800" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;how a = 10 is stored in the memory of a JavaScript engine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdd3s530vr2e1iz54z7tt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdd3s530vr2e1iz54z7tt.png" alt=" " width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In box format:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmobcd05t04bh6zaf4125.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmobcd05t04bh6zaf4125.png" alt=" " width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
