---
title: "Discussion on \"Why Does 0.1 + 0.2 Not Equal 0.3 in Python?\" | Hashnode"
description: "Discussion on \"Why Does 0.1 + 0.2 Not Equal 0.3 in Python?\". print(0.1 + 0.2) gives 0.30000000000000004. Learn why floating-point numbers do this and how to fix it with round(), math.isclose() and Decimal."
url: "https://hashnode.com/posts/why-does-0-1-0-2-not-equal-0-3-in-python/6ae8c3867da795e6dd936aa7"
---

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

Discussion

# [Why Does 0.1 + 0.2 Not Equal 0.3 in Python?](https://craftstack.hashnode.dev/why-does-0-1-0-2-not-equal-0-3-in-python?utm_source=hashnode&utm_medium=feed)

print(0.1 + 0.2) gives 0.30000000000000004. Learn why floating-point numbers do this and how to fix it with round(), math.isclose() and Decimal.

Nov 2 · 4 min read · craftstack.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#learn-coding](https://hashnode.com/tag/learn-coding)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Craftstack Academy](https://hashnode.com/@cstackacademy)

@cstackacademy

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

AI coding tutor for beginners: Python, Web, SQL, Java. Free trial: craftstackacademy.com/trial

One-hour coding sessions with an AI tutor. You write every line. Free 20-minute trial, no card.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
