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
Python Variables Variable Names Assign Multiple Values Output Variables Global Variables Variable Exercises Code Challenge Python Data Types
Discussions

What is the Python equivalent of C types float, double and long? - Stack Overflow
What is the Python equivalent of these C types: float double long I want to represent a float in the above three forms. More on stackoverflow.com
🌐 stackoverflow.com
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
Datatypes: get back 80-bit long double, 80-bit float support in general,
hi, sorry if silly question, I have! searched before asking, from another application ( gnumeric ) I managed to call’ python, do some calculation, and get back a result, with IEEE doubles. When trying to use 80-bit long doubles I can convert them to e.g. numpy longdoubles via longdouble( ... More on discuss.python.org
🌐 discuss.python.org
14
0
September 3, 2023
[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
🌐
Python documentation
docs.python.org › 3 › library › stdtypes.html
Built-in Types — Python 3.14.3 documentation
February 25, 2026 - Integers have unlimited precision. Floating-point numbers are usually implemented using double in C; information about the precision and internal representation of floating-point numbers for the machine on which your program is running is available in sys.float_info.
🌐
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!

🌐
Real Python
realpython.com › python-double-underscore
Single and Double Underscores in Python Names – Real Python
August 18, 2025 - Underscores in Python names indicate intent: a single leading underscore signals a non-public name, a single trailing underscore helps avoid naming conflicts, and a double leading underscore triggers name mangling for class attributes and methods.
Find elsewhere
🌐
eSparkBiz
esparkinfo.com › double precision floating values
How to Use Double Precision Floating Values in Python
January 21, 2026 - Python’s float type stores values using 64 bits (double precision).
Price   $12
Address   1001 - 1009 10th floor City Center 2, Sukan Mall Cross Road, Science City Rd, 380060, Ahmedabad
🌐
Flexiple
flexiple.com › python › convert-string-double-python
Converting String to Double in Python - Flexiple
March 22, 2024 - Python provides a convenient built-in method called the float() function to convert strings to doubles. This function takes a string as input and returns the corresponding floating-point number.
🌐
Python documentation
docs.python.org › 3 › reference › expressions.html
6. Expressions — Python 3.14.3 documentation
February 23, 2026 - A double asterisk ** denotes dictionary unpacking. Its operand must be a mapping. Each mapping item is added to the new dictionary.
🌐
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 - The ** (double star)operator in Python is used for exponentiation. It raises the number on the left to the power of the number on the right.
🌐
Python.org
discuss.python.org › python help
Datatypes: get back 80-bit long double, 80-bit float support in general, - Python Help - Discussions on Python.org
hi, sorry if silly question, I have! searched before asking, from another application ( gnumeric ) I managed to call’ python, do some calculation, and get back a result, with IEEE doubles. When trying to use 80-bit long doubles I can convert them to e.g. numpy longdoubles via longdouble( ...
Published   September 3, 2023
🌐
Python
docs.python.org › 3 › c-api › float.html
Floating-Point Objects — Python 3.14.3 documentation
Return a C double representation of the contents of pyfloat. If pyfloat is not a Python floating-point object but has a __float__() method, this method will first be called to convert pyfloat into a float. If __float__() is not defined then it falls back to __index__().
🌐
NumPy
numpy.org › doc › 1.22 › user › basics.types.html
Data types — NumPy v1.22 Manual
Python’s floating-point numbers are usually 64-bit floating-point numbers, nearly equivalent to np.float64. In some unusual situations it may be useful to use floating-point numbers with more precision. Whether this is possible in numpy depends on the hardware and on the development environment: specifically, x86 machines provide hardware floating-point with 80-bit precision, and while most C compilers provide this as their long double type, MSVC (standard for Windows builds) makes long double identical to double (64 bits).
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-string-to-double-in-python3
Convert String to Double in Python3 - GeeksforGeeks
October 8, 2021 - from decimal import Decimal str1 = "9.02" print("This is the initial string: " + str1) # Converting to double str2 = Decimal(str1) print("The conversion of string to double is", str2) str2 = str2+1 print("The converted string to double is incremented by 1:", str2)
🌐
Real Python
realpython.com › python-data-types
Basic Data Types in Python: A Quick Exploration – Real Python
December 21, 2024 - 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.
🌐
4Geeks
4geeks.com › how-to › what-does-double-equal-mean-in-python
What does a double equal sign mean in Python?
July 16, 2025 - In this way, Python compares values on both sides of the operator and returns True if they are equal and False if they are not. Now, let's see different conditions' use cases. 1num1 = 15 2num2 = 15 3 4if num1 == num2: 5 print("Both numbers are the same") 6else: 7 print("Numbers are different") In the previous example, we have two variables with the same numbers as values. When using the double equal sign ==, the program will print "Both numbers are the same" since both variables have the same number.
🌐
freeCodeCamp
freecodecamp.org › news › what-does-double-slash-mean-in-python
What Does // Mean in Python? Operators in Python
July 21, 2022 - In Python, you use the double slash // operator to perform floor division. This // operator divides the first number by the second number and rounds the result down to the nearest integer (or whole number).
🌐
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” ...
Top answer
1 of 16
1684

Single Underscore

In a class, names with a leading underscore indicate to other programmers that the attribute or method is intended to be be used inside that class. However, privacy is not enforced in any way. Using leading underscores for functions in a module indicates it should not be imported from somewhere else.

From the PEP-8 style guide:

_single_leading_underscore: weak "internal use" indicator. E.g. from M import * does not import objects whose name starts with an underscore.

Double Underscore (Name Mangling)

From the Python docs:

Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped. This mangling is done without regard to the syntactic position of the identifier, so it can be used to define class-private instance and class variables, methods, variables stored in globals, and even variables stored in instances. private to this class on instances of other classes.

And a warning from the same page:

Name mangling is intended to give classes an easy way to define “private” instance variables and methods, without having to worry about instance variables defined by derived classes, or mucking with instance variables by code outside the class. Note that the mangling rules are designed mostly to avoid accidents; it still is possible for a determined soul to access or modify a variable that is considered private.

Example

>>> class MyClass():
...     def __init__(self):
...             self.__superprivate = "Hello"
...             self._semiprivate = ", world!"
...
>>> mc = MyClass()
>>> print mc.__superprivate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: myClass instance has no attribute '__superprivate'
>>> print mc._semiprivate
, world!
>>> print mc.__dict__
{'_MyClass__superprivate': 'Hello', '_semiprivate': ', world!'}
2 of 16
589
  • _foo: Only a convention. A way for the programmer to indicate that the variable is private (whatever that means in Python).

  • __foo: This has real meaning. The interpreter replaces this name with _classname__foo as a way to ensure that the name will not overlap with a similar name in another class.

  • __foo__: Only a convention. A way for the Python system to use names that won't conflict with user names.

No other form of underscores have meaning in the Python world. Also, there's no difference between class, variable, global, etc in these conventions.

🌐
FavTutor
favtutor.com › blogs › convert-string-to-double-python
Convert String to Double in Python (3 Easy Methods)
October 27, 2022 - You can convert a string to double in Python using the float() method. This method requires only one parameter and returns the input as float (here, double). This is also a common method to convert a string to float in Python.