---
title: "Discussion on \"Do you know 0.1 + 0.2 ≠ 0.3 in JavaScript? Here is why!\" | Hashnode"
description: "Discussion on \"Do you know 0.1 + 0.2 ≠ 0.3 in JavaScript? Here is why!\". console.log(0.2 + 0.1) // 0.30000000000000004"
url: "https://hashnode.com/posts/do-you-know-01-02-03-in-javascript-here-is-why/60a74df42e1f1952ea820ab0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Do you know 0.1 + 0.2 ≠ 0.3 in JavaScript? Here is why!](https://pankajtanwar.hashnode.dev/do-you-know-01-02-03-in-javascript-here-is-why?utm_source=hashnode&utm_medium=feed)

console.log(0.2 + 0.1) // 0.30000000000000004

May 21, 2021 · 3 min read · pankajtanwar.hashnode.dev  
Updated Aug 25, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#mathematics](https://hashnode.com/tag/mathematics)

## Written by

[Pankaj Tanwar](https://hashnode.com/@pankajtanwar)

@pankajtanwar · Rajasthan.

  
[View profile](https://hashnode.com/@pankajtanwar)

I write about System Design & Web Tech. Curious about how things work!

## Responses 2

Markdown supported · ⌘↵ to post

[Akash Chaudhary](https://hashnode.com/@cyberlord007)

[Aug 1, 2021](https://hashnode.com/posts/do-you-know-01-02-03-in-javascript-here-is-why/60a74df42e1f1952ea820ab0/comment/61067ec833a2a43971a2e569)

Amazing! We always try to build on the top of the surface, we never try to scratch it and see what's beneath. Great job!

[Maxi Contieri](https://hashnode.com/@mcsee)

[May 22, 2021](https://hashnode.com/posts/do-you-know-01-02-03-in-javascript-here-is-why/60a74df42e1f1952ea820ab0/comment/60a919b65379f65d10b5f82a)

Your article is great, and it explains in details what happens under the surface

This is a classic example of a bad language with lots of accidental complexities.

Programmers need to address only about essential complexities (those imposed by the real domain)

I will use your article as an inspiration for yet another code smell.

Thank you very much

[Pankaj Tanwar](https://hashnode.com/@pankajtanwar)

[May 22, 2021](https://hashnode.com/posts/do-you-know-01-02-03-in-javascript-here-is-why/60a74df42e1f1952ea820ab0/comment/60a919b65379f65d10b5f82a#reply-60a926f020d1f45ceb7ee28f)

Thanks a lot [Maxi Contieri](https://hashnode.com/@mcsee). It feels so great to hear feedback from you.

Regarding this, It seems like we both are on the same page 😅.

[Maxi Contieri](https://hashnode.com/@mcsee)

[May 24, 2021](https://hashnode.com/posts/do-you-know-01-02-03-in-javascript-here-is-why/60a74df42e1f1952ea820ab0/comment/60a919b65379f65d10b5f82a#reply-60ab185920d1f45ceb7f0930)

[Pankaj Tanwar](https://hashnode.com/@pankajtanwar)

Thank you very much for your inspiration and examples.

I quoted you here

[maximilianocontieri.com/code-smell-71-magic-float…](https://maximilianocontieri.com/code-smell-71-magic-floats-disguised-as-decimals)
