>>> x = "2342.34"
>>> float(x)
2342.3400000000001

There you go. Use float (which behaves like and has the same precision as a C,C++, or Java double).

Answer from Mongoose on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-string-to-double-in-python3
Convert String to Double in Python3 - GeeksforGeeks
October 8, 2021 - Python Tutorial · Data Types · Interview Questions · Examples · Quizzes · DSA Python · Data Science · NumPy · Pandas · Practice · Django · Flask · Last Updated : 8 Oct, 2021 · Given a string and our task is to convert it in double.
🌐
Replit
replit.com › home › discover › how to declare a double in python
How to declare a double in Python | Replit
2 weeks ago - # Declare a floating-point number (equivalent to double in other languages) my_float = 3.14159 print(type(my_float), my_float)--OUTPUT--<class 'float'> 3.14159 · This example highlights Python's dynamic typing.
Discussions

How do I convert a string to a double in Python? - Stack Overflow
I would like to know how to convert a string containing digits to a double. More on stackoverflow.com
🌐 stackoverflow.com
[deleted by user]
Assuming you mean the c/c++ double type...? Any floating point number in python is stored as double. So 1.1 5.7 and -1453.653356 https://www.pythontutorial.net/advanced-python/python-float/ If not, please provide an example of the data type you mean. More on reddit.com
🌐 r/learnpython
7
1
May 2, 2022
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
108
May 1, 2025
Double precision
All Python floats are double precision by default. If you need even more precision, you have to use decimal or something. More on reddit.com
🌐 r/Python
16
1
October 17, 2019
🌐
FavTutor
favtutor.com › blogs › convert-string-to-double-python
Convert String to Double in Python (3 Easy Methods)
October 27, 2022 - Learn how to convert string to double in python. This includes float(), decimal(), and tonumeric() methods.
🌐
GeeksforGeeks
geeksforgeeks.org › python › what-does-the-double-star-operator-mean-in-python
What does the Double Star operator mean in Python? - GeeksforGeeks
July 23, 2025 - Python Tutorial · Data Types · ... · Django · Flask · Last Updated : 23 Jul, 2025 · The ** (double star)operator in Python is used for exponentiation....
🌐
Quora
quora.com › How-do-you-import-a-double-in-Python
How to import a double in Python - Quora
Answer: there is no such thing as a double in Python. A float in Python always uses the available double floating point data type, which means that a float in Python is actually a ‘double’ if you wrote the same software in C - in a 64 bit ...
🌐
Real Python
realpython.com › python-data-types
Basic Data Types in Python: A Quick Exploration – Real Python
December 21, 2024 - To build a single-line string literal, you can use double ("") or single quotes ('') and, optionally, a sequence of characters in between them. All the characters between the opening and closing quotes are part of the string: ... Python’s ...
Find elsewhere
🌐
Real Python
realpython.com › python-double-underscore
Single and Double Underscores in Python Names – Real Python
August 18, 2025 - Learn Python naming conventions with single and double underscores to design APIs, create safe classes, and prevent name clashes.
🌐
Flexiple
flexiple.com › python › convert-string-double-python
Converting String to Double in Python - Flexiple
March 22, 2024 - In this blog, we will walk you through various methods to efficiently convert strings to doubles in Python, catering to both simplicity and accuracy.
🌐
Python documentation
docs.python.org › 3 › tutorial › floatingpoint.html
15. Floating-Point Arithmetic: Issues and Limitations — Python 3.14.3 documentation
Why is that? 1/10 is not exactly representable as a binary fraction. Since at least 2000, almost all machines use IEEE 754 binary floating-point arithmetic, and almost all platforms map Python floats to IEEE 754 binary64 “double precision” values.
🌐
Medium
medium.com › @pythonchallengers › python-challenge-double-values-in-an-integer-array-c51ed098a2cd
Python Challenge: Double values in an integer array | by Python Challengers | Medium
December 6, 2023 - In this solution, a function named double_array is defined, which takes an array of integers called arr as an argument. The function uses list comprehension to generate a new list by iterating through each element num in the input array arr, and for each num, it calculates num * 2 to double its value. List comprehensions are a concise way to create lists in Python.
🌐
Quora
quora.com › How-do-you-print-a-double-value-in-Python
How to print a double value in Python - Quora
Answer (1 of 5): There are three distinct numeric types: integers, floating-point numbers, and complex numbers. In addition, Booleans are a subtype of integers. Integers have unlimited precision. Floating-point numbers are usually implemented using double. Information about the precision and int...
🌐
The Hard-Core Coder
thehardcorecoder.com › 2025 › 11 › 17 › dual-numbers-in-python
Dual Numbers in Python | The Hard-Core Coder
November 21, 2025 - Note that it’s important the function treats the dual number as an ordinary number but with dual number results at each step of the way. This means our dual numbers must act like regular Python numbers, and that means we need to define the math operators.
🌐
Learn Python
learnpython.org › en › Variables_and_Types
Variables and Types - Learn Python - Free Interactive Python Tutorial
The difference between the two is that using double quotes makes it easy to include apostrophes (whereas these would terminate the string if using single quotes) mystring = "Don't worry about apostrophes" print(mystring) There are additional variations on defining strings that make it easier to include things such as carriage returns, backslashes and Unicode characters. These are beyond the scope of this tutorial, but are covered in the Python documentation.
🌐
eSparkBiz
esparkinfo.com › double precision floating values
How to Use Double Precision Floating Values in Python
January 21, 2026 - Understand Python’s double precision float behavior and get practical tips on using decimal and fractions for exact numeric and financial results.
Price   $12
Address   1001 - 1009 10th floor City Center 2, Sukan Mall Cross Road, Science City Rd, 380060, Ahmedabad
🌐
Reddit
reddit.com › r/learnpython › [deleted by user]
What is a double? (Data type) : r/learnpython
May 2, 2022 - from google: Python does not have an inbuilt double data type, but it has a float type that designates a floating-point number. You can count double in Python as float values which are specified with a decimal point. All platforms represent Python float values as 64-bit “double-precision” ...
🌐
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.

🌐
Reddit
reddit.com › r/python › double precision
r/Python on Reddit: Double precision
October 17, 2019 -

Hi everyone!

I recently started a project with Python and after long weeks of writing code, I saw that Python's default float precision is just not enough for my needs.

Is there a simple way to change the default Python precision without having to rewrite all my code?

Thank you all in advance!