---
title: "What is the difference between .NET double and python float?"  
description: "What is the difference between .NET double and python float?"  
author: "Revati S Misra"  
published: 2023-08-18  
updated: 2023-08-19  
canonical: https://www.mindstick.com/forum/159576/what-is-the-difference-between-dot-net-double-and-python-float  
category: ".net"  
tags: [".net", "asp.net", "Data Types"]  
reading_time: 2 minutes  

---

# What is the difference between .NET double and python float?

What is the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between .NET double and [python](https://www.mindstick.com/articles/75378/simple-yet-useful-tips-when-using-python) [float](https://www.mindstick.com/interview/1718/describe-float-containment)?

## Replies

### Reply by Aryan Kumar

The main difference between .NET double and Python float is the precision. A .NET double is a 64-bit floating-point number, while a Python float is a 64-bit or 32-bit floating-point number, depending on the Python version and platform. This means that a .NET double can represent numbers with more precision than a Python float.

Here is a table summarizing the differences between .NET double and Python float:

| Feature | .NET double | Python float |
| --- | --- | --- |
| Precision | 64 bits | 64 bits or 32 bits |
| Range | ±1.7976931348623157e+308 | ±1.7976931348623157e+308 for 64-bit floats, ±3.4028234663852886e+38 for 32-bit floats |
| Memory usage | 8 bytes | 4 bytes for 32-bit floats, 8 bytes for 64-bit floats |

In general, you should use a .NET double when you need to represent numbers with high precision. You should use a Python float when you need to represent numbers with less precision or when you are limited by memory constraints.

Here are some examples of when you should use a .NET double:

- Storing the value of pi
- Storing the weight of an object in grams
- Storing the temperature in Celsius
- Storing the area of a circle in square meters

Here are some examples of when you should use a Python float:

- Storing the price of an item in dollars
- Storing the balance of an account in cents
- Storing the interest rate on a loan in percent
- Storing the exchange rate between two currencies


---

Original Source: https://www.mindstick.com/forum/159576/what-is-the-difference-between-dot-net-double-and-python-float

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
