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.
Top answer 1 of 5
198
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.
2 of 5
75
Decimal datatype
- Unlike hardware based binary floating point, the decimal module has a user alterable precision (defaulting to 28 places) which can be as large as needed for a given problem.
If you are pressed by performance issuses, have a look at GMPY
float vs. double – What's the Key Difference?"
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. More on reddit.com
Double precision
There is no fixed number of digits in a "double float". 30 decimal digits of precision is definitely not realistic. ... Well, the equivalent of a quadruple precision floating point is 33 to 36 significant digits according to wikipedia · https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format ... Like K900_ said, there are no fixed digits. Floats (Python... More on reddit.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
Is floating point math deterministic?
Ok r/programming , it looks like we need to have a discussion on what it means to be "deterministic". Deterministic means that given some input, will a operation produce the same output every time. So, for example, lets say you have a function that says add(a, b); that function always returns 4 when a = 2 and b = 2, then that function is deterministic. If that function always returns 7 when given a = 2 and b = 2, that function is STILL deterministic. If that function always returns 3 when a = 2 and b = 2 and the micro architecture is a ARM version 7 processor, that function is STILL deterministic. The key is that the function ALWAYS returns the same result given a certain input regardless of if the result is correct or not. Deterministic means something behaves exactly the same way given the same input. It has nothing to do with compiler optimization, architecture differences, or data representation limitations. A piece of code that behaves differently across platforms is still deterministic, but inconsistent across platforms. In that light, it should be clear that floating point math IS deterministic. Processors don't randomly spit out numbers when you tell them to add two floating points, the answer is predictable. It may be different across platforms, but it is still consistent. When it is inconsistent, generally the processor has more issues and is due to cause the system to crash. If it was not deterministic, we would have a source for good solid random numbers on all platforms. We could do floating point math on a couple of static numbers, and then pull off the last bits of the results. Viola, real random numbers done quickly. Alas, floating point math is deterministic and that doesn't work (hence, nobody does it). More on reddit.com
03:44
how to declare double in python - YouTube
11:10
Como usar os Tipos de Variáveis? | Int - Double - Char - String ...
03:14
define double in python - YouTube
Floats and Integers | How To Python - YouTube
01:11
PYTHON : Double precision floating values in Python? - YouTube
10:11
Underflow and Overflow limits of Double Precision Floating Point ...
Squash
squash.io › how-to-use-double-precision-floating-values-in-python
How to Use Double Precision Floating Values in Python
November 2, 2023 - In this example, we compare two double precision floating values, value1 and value2, using both math.isclose and a tolerance value. The rel_tol parameter in math.isclose specifies the relative tolerance, which is the maximum allowed difference between the two values. Related Article: How to Check If Something Is Not In A Python List
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.
Reddit
reddit.com › r/learnpython › [deleted by user]
[deleted by user] : 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.
eSparkBiz
esparkinfo.com › double precision floating values
How to Use Double Precision Floating Values in Python
September 2, 2025 - Python’s float type stores values using 64 bits (double precision).
Reddit
reddit.com › r/python › double precision
r/Python on Reddit: Double precision
October 17, 2019 - All Python floats are double precision by default.
Python Reference
python-reference.readthedocs.io › en › latest › docs › float
float — Python Reference (The Right Way) 0.1 documentation
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 is 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.
Python Tutorial
pythontutorial.net › home › advanced python › python float
An Essential Guide to Python float Type By Examples
September 10, 2022 - Python uses the float class to represent real numbers. CPython implements float using C double type.