Python's built-in float type has double precision (it's a C double in CPython, a Java double in Jython). If you need more precision, get NumPy and use its numpy.float128.

Answer from Fred Foo on Stack Overflow
🌐
W3Schools
w3schools.com › python › python_datatypes.asp
Python Data Types
In programming, data type is an important concept. Variables can store data of different types, and different types can do different things. Python has the following data types built-in by default, in these categories:
Discussions

TIL a Python float is the same (precision) as a Java double
Just wait until you find out what an int is in python More on reddit.com
🌐 r/learnpython
85
109
May 1, 2025
Double precision
Thank you all in advance! Archived post. New comments cannot be posted and votes cannot be cast. Share ... All Python floats are double precision by default. More on reddit.com
🌐 r/Python
16
1
October 17, 2019
🌐
Reddit
reddit.com › r/learnprogramming › float vs. double – what's the key difference?"
r/learnprogramming on Reddit: float vs. double – What's the Key Difference?"
November 2, 2024 - In languages that have both float and double, that's what they mean. But then you'll have languages like python, which only have a float type and no double type, and Python's floats are actually double-precision.
🌐
Codefinity
codefinity.com › blog › Float-vs-Double
Float vs Double
my_float = 3.14 # Python uses 64-bit IEEE 754 double precision by default · JavaScript does not differentiate between different types of floating point numbers; it only has one data type for decimals — number, which is implemented as double-precision floating point according to IEEE 754.
🌐
Python
docs.python.org › 3 › builtins › stdtypes.html
Built-in Types — Python 3.15.2 documentation
This syntax is similar to the syntax specified in section 6.4.4.2 of the C99 standard, and also to the syntax used in Java 1.5 onwards. In particular, the output of float.hex() is usable as a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C’s %a format character or Java’s Double.toHexString are accepted by float.fromhex().
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-string-to-double-in-python3
Convert String to Double in Python3 - GeeksforGeeks
October 8, 2021 - So conversion of string to double is the same as the conversion of string to float ... str1 = "9.02" print("This is the initial string: " + str1) # Converting to double str2 = float(str1) print("The conversion of string to double is", str2) str2 = str2+1 print("The converted string to double is incremented by 1:", str2)
Find elsewhere
🌐
Facebook
facebook.com › fb-answers › what-is-a-double-in-python
What Is a Double in Python
Explore the things you love · Log into Facebook · English (US) · فارسی · العربية · Türkçe · Deutsch · Français (France) · Polski · More languages…
🌐
Uchicago
geosci.uchicago.edu › ~rtp1 › itr › PythonLectures › DoubleGotcha.html
Promotion of Numeric arrays to double
When arithmetic operations are performed on operands of differing types, including Numeric arrays, Python promotes all types to the highest and stores the result as the resulting highest type. An operation on a Float32 and a Float (which is double precision) results in a Float.
🌐
Real Python
realpython.com › python-data-types
Basic Data Types in Python: A Quick Exploration – Real Python
5 days ago - You can also use literals to create strings. To build a single-line string literal, you can use double ("") or single quotes ('') and, optionally, a sequence of characters in between them.
🌐
Reddit
reddit.com › r/learnpython › til a python float is the same (precision) as a java double
r/learnpython on Reddit: TIL a Python float is the same (precision) as a Java double
May 1, 2025 -

TL;DR in Java a "double" is a 64-bit float and a "float" is a 32-bit float; in Python a "float" is a 64-bit float (and thus equivalent to a Java double). There doesn't appear to be a natively implemented 32-bit float in Python (I know numpy/pandas has one, but I'm talking about straight vanilla Python with no imports).

In many programming languages, a double variable type is a higher precision float and unless there was a performance reason, you'd just use double (vs. a float). I'm almost certain early in my programming "career", I banged my head against the wall because of precision issues while using floats thus I avoided floats like the plague.

In other languages, you need to type a variable while declaring it.

Java: int age=30
Python: age=30

As Python doesn't have (or require?) typing a variable before declaring it, I never really thought about what the exact data type was when I divided stuff in Python, but on my current project, I've gotten in the habit of hinting at variable type for function/method arguments.

def do_something(age: int, name: str):

I could not find a double data type in Python and after a bunch of research it turns out that the float I've been avoiding using in Python is exactly a double in Java (in terms of precision) with just a different name.

Hopefully this info is helpful for others coming to Python with previous programming experience.

P.S. this is a whole other rabbit hole, but I'd be curious as to the original thought process behind Python not having both a 32-bit float (float) and 64-bit float (double). My gut tells me that Python was just designed to be "easier" to learn and thus they wanted to reduce the number of basic variable types.

🌐
Python
docs.python.org › 3 › c-api › float.html
Floating-Point Objects — Python 3.15.2 documentation
It is equivalent to the INFINITY macro from the C11 standard <math.h> header. Soft deprecated since version 3.15. ... This macro expands to a constant expression of type double, that represents a quiet not-a-number (qNaN) value.
🌐
Reddit
reddit.com › r/python › double precision
r/Python on Reddit: Double precision
October 17, 2019 - Thank you all in advance! Archived post. New comments cannot be posted and votes cannot be cast. Share ... All Python floats are double precision by default.
🌐
Data Science Discovery
discovery.cs.illinois.edu › guides › Python-Fundamentals › Python-data-types
Python Data Types - Data Science Discovery
Here's a summary of some commonly used data types in Python: Integer (int): Whole numbers without any decimal point, e.g., 5, -10, 100. Float (float): Numbers with a decimal point or numbers written in exponential form, e.g., 3.14, -0.001, 2.5e2. String (str): Ordered sequence of characters enclosed within single, double, or triple quotes, e.g., "hello", 'world', '''multiline string'''. In most cases, single quotes (' ') and double quotes (" ") can be used interchangeably
🌐
RC Learning Portal
learning.rc.virginia.edu › courses › python-introduction › variables
Variables and Types | RC Learning Portal
In most languages there are two types of floating-point numbers, single precision and double precision. Single precision numbers are 32 bits long in total. Double precision numbers occupy 64 bits. Most of the time a Python floating-point variable ...
🌐
AskPython
askpython.com › python › examples › high-precision-numerical-calculations
Double precision floating values in Python - AskPython
January 27, 2024 - Python’s built-in float data type provides up to 15 digits of decimal precision. While sufficient for most applications, some numerical computations require even higher precision. Luckily, Python offers some great options for working with high-precision decimal values. Python’s standard float type, based on double-precision IEEE 754 format, provides up to 15 decimal digits of precision.
🌐
Zhihu
zhihu.com › en › answer › 880891751
In Python, what are double floating-point numbers and long ...
Can you accept that your future child will take the mother's surname · Actually, I still support it. If it's a two-way marriage, the economic burden on families with sons would be reduced by more than a little.Actually, I still support it. If it's a two-way marriage, the economic burden on ...
🌐
Wikipedia
en.wikipedia.org › wiki › Double-precision_floating-point_format
Double-precision floating-point format - Wikipedia
3 weeks ago - Double-precision floating-point format (sometimes called FP64 or float64) is a floating-point number format, usually occupying 64 bits in computer memory; it represents a wide range of numeric values by using a floating radix point.
🌐
freeCodeCamp
freecodecamp.org › news › what-does-double-slash-mean-in-python
What Does // Mean in Python? Operators in Python
July 21, 2022 - In Python, math.floor() rounds down a number to the nearest integer, just like the double slash // operator does.
🌐
Python documentation
docs.python.org › 3 › reference › datamodel.html
3. Data model — Python 3.15.2 documentation
The Boolean type is a subtype of the integer type, and Boolean values behave like the values 0 and 1, respectively, in almost all contexts, the exception being that when converted to a string, the strings "False" or "True" are returned, respectively. These represent machine-level double precision floating-point numbers. You are at the mercy of the underlying machine architecture (and C or Java implementation) for the accepted range and handling of overflow. Python does not support single-precision floating-point numbers; the savings in processor and memory usage that are usually the reason for using these are dwarfed by the overhead of using objects in Python, so there is no reason to complicate the language with two kinds of floating-point numbers.
🌐
GitHub
gist.github.com › devops-school › 5156f28b089b077069dbb9a18224364e
Python Tutorials: DataTypes In Python · GitHub
To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters · Show hidden characters · Raw · python-datatypes.py · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.