summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-07-19 08:06:02 (GMT)
committerGitHub <noreply@github.com>2024-07-19 08:06:02 (GMT)
commit1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356 (patch)
treedf3bcce3fcd01a8230304dad9431cfab8ef406cb /Doc
parent420d94312824825a18fa1fd9a36773626a54d97a (diff)
downloadcpython-1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356.zip
cpython-1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356.tar.gz
cpython-1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356.tar.bz2
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/arg.rst8
-rw-r--r--Doc/c-api/float.rst10
-rw-r--r--Doc/c-api/marshal.rst2
-rw-r--r--Doc/c-api/number.rst8
-rw-r--r--Doc/faq/design.rst4
-rw-r--r--Doc/faq/library.rst4
-rw-r--r--Doc/faq/programming.rst2
-rw-r--r--Doc/library/array.rst4
-rw-r--r--Doc/library/colorsys.rst2
-rw-r--r--Doc/library/configparser.rst2
-rw-r--r--Doc/library/decimal.rst22
-rw-r--r--Doc/library/email.utils.rst2
-rw-r--r--Doc/library/exceptions.rst4
-rw-r--r--Doc/library/fractions.rst2
-rw-r--r--Doc/library/functions.rst14
-rw-r--r--Doc/library/itertools.rst2
-rw-r--r--Doc/library/locale.rst4
-rw-r--r--Doc/library/marshal.rst6
-rw-r--r--Doc/library/math.rst6
-rw-r--r--Doc/library/os.path.rst4
-rw-r--r--Doc/library/profile.rst2
-rw-r--r--Doc/library/random.rst12
-rw-r--r--Doc/library/resource.rst2
-rw-r--r--Doc/library/select.rst2
-rw-r--r--Doc/library/socket.rst2
-rw-r--r--Doc/library/statistics.rst2
-rw-r--r--Doc/library/stdtypes.rst52
-rw-r--r--Doc/library/string.rst6
-rw-r--r--Doc/library/threading.rst6
-rw-r--r--Doc/library/time.rst10
-rw-r--r--Doc/reference/datamodel.rst14
-rw-r--r--Doc/reference/expressions.rst12
-rw-r--r--Doc/reference/lexical_analysis.rst16
-rw-r--r--Doc/tutorial/floatingpoint.rst8
-rw-r--r--Doc/tutorial/introduction.rst4
-rw-r--r--Doc/tutorial/stdlib.rst2
-rw-r--r--Doc/tutorial/stdlib2.rst4
-rw-r--r--Doc/using/configure.rst4
-rw-r--r--Doc/whatsnew/2.1.rst4
-rw-r--r--Doc/whatsnew/2.2.rst2
-rw-r--r--Doc/whatsnew/2.3.rst2
-rw-r--r--Doc/whatsnew/2.6.rst2
-rw-r--r--Doc/whatsnew/2.7.rst2
-rw-r--r--Doc/whatsnew/3.1.rst16
-rw-r--r--Doc/whatsnew/3.11.rst2
-rw-r--r--Doc/whatsnew/3.2.rst2
-rw-r--r--Doc/whatsnew/3.3.rst4
-rw-r--r--Doc/whatsnew/3.6.rst2
-rw-r--r--Doc/whatsnew/3.7.rst2
-rw-r--r--Doc/whatsnew/3.8.rst2
50 files changed, 157 insertions, 157 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 834aae9..3201bdc 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -280,10 +280,10 @@ Numbers
length 1, to a C :c:expr:`int`.
``f`` (:class:`float`) [float]
- Convert a Python floating point number to a C :c:expr:`float`.
+ Convert a Python floating-point number to a C :c:expr:`float`.
``d`` (:class:`float`) [double]
- Convert a Python floating point number to a C :c:expr:`double`.
+ Convert a Python floating-point number to a C :c:expr:`double`.
``D`` (:class:`complex`) [Py_complex]
Convert a Python complex number to a C :c:type:`Py_complex` structure.
@@ -642,10 +642,10 @@ Building values
object of length 1.
``d`` (:class:`float`) [double]
- Convert a C :c:expr:`double` to a Python floating point number.
+ Convert a C :c:expr:`double` to a Python floating-point number.
``f`` (:class:`float`) [float]
- Convert a C :c:expr:`float` to a Python floating point number.
+ Convert a C :c:expr:`float` to a Python floating-point number.
``D`` (:class:`complex`) [Py_complex \*]
Convert a C :c:type:`Py_complex` structure to a Python complex number.
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst
index 4f6ac0d..1da37a5 100644
--- a/Doc/c-api/float.rst
+++ b/Doc/c-api/float.rst
@@ -2,20 +2,20 @@
.. _floatobjects:
-Floating Point Objects
+Floating-Point Objects
======================
-.. index:: pair: object; floating point
+.. index:: pair: object; floating-point
.. c:type:: PyFloatObject
- This subtype of :c:type:`PyObject` represents a Python floating point object.
+ This subtype of :c:type:`PyObject` represents a Python floating-point object.
.. c:var:: PyTypeObject PyFloat_Type
- This instance of :c:type:`PyTypeObject` represents the Python floating point
+ This instance of :c:type:`PyTypeObject` represents the Python floating-point
type. This is the same object as :class:`float` in the Python layer.
@@ -45,7 +45,7 @@ Floating Point Objects
.. c:function:: double PyFloat_AsDouble(PyObject *pyfloat)
Return a C :c:expr:`double` representation of the contents of *pyfloat*. If
- *pyfloat* is not a Python floating point object but has a :meth:`~object.__float__`
+ *pyfloat* is not a Python floating-point object but has a :meth:`~object.__float__`
method, this method will first be called to convert *pyfloat* into a float.
If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`.
This method returns ``-1.0`` upon failure, so one should call
diff --git a/Doc/c-api/marshal.rst b/Doc/c-api/marshal.rst
index 489f158..b9085ad 100644
--- a/Doc/c-api/marshal.rst
+++ b/Doc/c-api/marshal.rst
@@ -15,7 +15,7 @@ Numeric values are stored with the least significant byte first.
The module supports two versions of the data format: version 0 is the
historical version, version 1 shares interned strings in the file, and upon
-unmarshalling. Version 2 uses a binary format for floating point numbers.
+unmarshalling. Version 2 uses a binary format for floating-point numbers.
``Py_MARSHAL_VERSION`` indicates the current file format (currently 2).
diff --git a/Doc/c-api/number.rst b/Doc/c-api/number.rst
index 13d3c5a..ad8b593 100644
--- a/Doc/c-api/number.rst
+++ b/Doc/c-api/number.rst
@@ -51,8 +51,8 @@ Number Protocol
Return a reasonable approximation for the mathematical value of *o1* divided by
*o2*, or ``NULL`` on failure. The return value is "approximate" because binary
- floating point numbers are approximate; it is not possible to represent all real
- numbers in base two. This function can return a floating point value when
+ floating-point numbers are approximate; it is not possible to represent all real
+ numbers in base two. This function can return a floating-point value when
passed two integers. This is the equivalent of the Python expression ``o1 / o2``.
@@ -177,8 +177,8 @@ Number Protocol
Return a reasonable approximation for the mathematical value of *o1* divided by
*o2*, or ``NULL`` on failure. The return value is "approximate" because binary
- floating point numbers are approximate; it is not possible to represent all real
- numbers in base two. This function can return a floating point value when
+ floating-point numbers are approximate; it is not possible to represent all real
+ numbers in base two. This function can return a floating-point value when
passed two integers. The operation is done *in-place* when *o1* supports it.
This is the equivalent of the Python statement ``o1 /= o2``.
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index c8beb64..ebb6d5e 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -70,7 +70,7 @@ operations. This means that as far as floating-point operations are concerned,
Python behaves like many popular languages including C and Java.
Many numbers that can be written easily in decimal notation cannot be expressed
-exactly in binary floating-point. For example, after::
+exactly in binary floating point. For example, after::
>>> x = 1.2
@@ -87,7 +87,7 @@ which is exactly::
The typical precision of 53 bits provides Python floats with 15--16
decimal digits of accuracy.
-For a fuller explanation, please see the :ref:`floating point arithmetic
+For a fuller explanation, please see the :ref:`floating-point arithmetic
<tut-fp-issues>` chapter in the Python tutorial.
diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst
index a290095..d8d75ca 100644
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -718,12 +718,12 @@ is simple::
import random
random.random()
-This returns a random floating point number in the range [0, 1).
+This returns a random floating-point number in the range [0, 1).
There are also many other specialized generators in this module, such as:
* ``randrange(a, b)`` chooses an integer in the range [a, b).
-* ``uniform(a, b)`` chooses a floating point number in the range [a, b).
+* ``uniform(a, b)`` chooses a floating-point number in the range [a, b).
* ``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution.
Some higher-level functions operate on sequences directly, such as:
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 61fbd1b..3ac8cc1 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -869,7 +869,7 @@ How do I convert a string to a number?
--------------------------------------
For integers, use the built-in :func:`int` type constructor, e.g. ``int('144')
-== 144``. Similarly, :func:`float` converts to floating-point,
+== 144``. Similarly, :func:`float` converts to a floating-point number,
e.g. ``float('144') == 144.0``.
By default, these interpret the number as decimal, so that ``int('0144') ==
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
index d34a188..e0b1eb8 100644
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -9,7 +9,7 @@
--------------
This module defines an object type which can compactly represent an array of
-basic values: characters, integers, floating point numbers. Arrays are sequence
+basic values: characters, integers, floating-point numbers. Arrays are sequence
types and behave very much like lists, except that the type of objects stored in
them is constrained. The type is specified at object creation time by using a
:dfn:`type code`, which is a single character. The following type codes are
@@ -263,7 +263,7 @@ The string representation is guaranteed to be able to be converted back to an
array with the same type and value using :func:`eval`, so long as the
:class:`~array.array` class has been imported using ``from array import array``.
Variables ``inf`` and ``nan`` must also be defined if it contains
-corresponding floating point values.
+corresponding floating-point values.
Examples::
array('l')
diff --git a/Doc/library/colorsys.rst b/Doc/library/colorsys.rst
index 125d62b..ffebf4e 100644
--- a/Doc/library/colorsys.rst
+++ b/Doc/library/colorsys.rst
@@ -14,7 +14,7 @@ The :mod:`colorsys` module defines bidirectional conversions of color values
between colors expressed in the RGB (Red Green Blue) color space used in
computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness
Saturation) and HSV (Hue Saturation Value). Coordinates in all of these color
-spaces are floating point values. In the YIQ space, the Y coordinate is between
+spaces are floating-point values. In the YIQ space, the Y coordinate is between
0 and 1, but the I and Q coordinates can be positive or negative. In all other
spaces, the coordinates are all between 0 and 1.
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index 6fae03c..7aaad93 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -1183,7 +1183,7 @@ ConfigParser Objects
.. method:: getfloat(section, option, *, raw=False, vars=None[, fallback])
A convenience method which coerces the *option* in the specified *section*
- to a floating point number. See :meth:`get` for explanation of *raw*,
+ to a floating-point number. See :meth:`get` for explanation of *raw*,
*vars* and *fallback*.
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst
index db32380..916f17c 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -1,4 +1,4 @@
-:mod:`!decimal` --- Decimal fixed point and floating point arithmetic
+:mod:`!decimal` --- Decimal fixed-point and floating-point arithmetic
=====================================================================
.. module:: decimal
@@ -31,7 +31,7 @@
--------------
The :mod:`decimal` module provides support for fast correctly rounded
-decimal floating point arithmetic. It offers several advantages over the
+decimal floating-point arithmetic. It offers several advantages over the
:class:`float` datatype:
* Decimal "is based on a floating-point model which was designed with people
@@ -207,7 +207,7 @@ a decimal raises :class:`InvalidOperation`::
.. versionchanged:: 3.3
Decimals interact well with much of the rest of Python. Here is a small decimal
-floating point flying circus:
+floating-point flying circus:
.. doctest::
:options: +NORMALIZE_WHITESPACE
@@ -373,7 +373,7 @@ Decimal objects
digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))``
returns ``Decimal('1.414')``.
- If *value* is a :class:`float`, the binary floating point value is losslessly
+ If *value* is a :class:`float`, the binary floating-point value is losslessly
converted to its exact decimal equivalent. This conversion can often require
53 or more digits of precision. For example, ``Decimal(float('1.1'))``
converts to
@@ -403,7 +403,7 @@ Decimal objects
Underscores are allowed for grouping, as with integral and floating-point
literals in code.
- Decimal floating point objects share many properties with the other built-in
+ Decimal floating-point objects share many properties with the other built-in
numeric types such as :class:`float` and :class:`int`. All of the usual math
operations and special methods apply. Likewise, decimal objects can be
copied, pickled, printed, used as dictionary keys, used as set elements,
@@ -445,7 +445,7 @@ Decimal objects
Mixed-type comparisons between :class:`Decimal` instances and other
numeric types are now fully supported.
- In addition to the standard numeric properties, decimal floating point
+ In addition to the standard numeric properties, decimal floating-point
objects also have a number of specialized methods:
@@ -1741,7 +1741,7 @@ The following table summarizes the hierarchy of signals::
.. _decimal-notes:
-Floating Point Notes
+Floating-Point Notes
--------------------
@@ -1754,7 +1754,7 @@ can still incur round-off error when non-zero digits exceed the fixed precision.
The effects of round-off error can be amplified by the addition or subtraction
of nearly offsetting quantities resulting in loss of significance. Knuth
-provides two instructive examples where rounded floating point arithmetic with
+provides two instructive examples where rounded floating-point arithmetic with
insufficient precision causes the breakdown of the associative and distributive
properties of addition:
@@ -1844,7 +1844,7 @@ treated as equal and their sign is informational.
In addition to the two signed zeros which are distinct yet equal, there are
various representations of zero with differing precisions yet equivalent in
value. This takes a bit of getting used to. For an eye accustomed to
-normalized floating point representations, it is not immediately obvious that
+normalized floating-point representations, it is not immediately obvious that
the following calculation returns a value equal to zero:
>>> 1 / Decimal('Infinity')
@@ -2171,7 +2171,7 @@ value unchanged:
Q. Is there a way to convert a regular float to a :class:`Decimal`?
-A. Yes, any binary floating point number can be exactly expressed as a
+A. Yes, any binary floating-point number can be exactly expressed as a
Decimal though an exact conversion may take more precision than intuition would
suggest:
@@ -2225,7 +2225,7 @@ Q. Is the CPython implementation fast for large numbers?
A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of
the decimal module integrate the high speed `libmpdec
<https://www.bytereef.org/mpdecimal/doc/libmpdec/index.html>`_ library for
-arbitrary precision correctly rounded decimal floating point arithmetic [#]_.
+arbitrary precision correctly rounded decimal floating-point arithmetic [#]_.
``libmpdec`` uses `Karatsuba multiplication
<https://en.wikipedia.org/wiki/Karatsuba_algorithm>`_
for medium-sized numbers and the `Number Theoretic Transform
diff --git a/Doc/library/email.utils.rst b/Doc/library/email.utils.rst
index 43e5b25..6115496 100644
--- a/Doc/library/email.utils.rst
+++ b/Doc/library/email.utils.rst
@@ -158,7 +158,7 @@ of the new API.
Fri, 09 Nov 2001 01:08:47 -0000
- Optional *timeval* if given is a floating point time value as accepted by
+ Optional *timeval* if given is a floating-point time value as accepted by
:func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is
used.
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 7910b30..b5ba86f 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -412,8 +412,8 @@ The following exceptions are the exceptions that are usually raised.
represented. This cannot occur for integers (which would rather raise
:exc:`MemoryError` than give up). However, for historical reasons,
OverflowError is sometimes raised for integers that are outside a required
- range. Because of the lack of standardization of floating point exception
- handling in C, most floating point operations are not checked.
+ range. Because of the lack of standardization of floating-point exception
+ handling in C, most floating-point operations are not checked.
.. exception:: PythonFinalizationError
diff --git a/Doc/library/fractions.rst b/Doc/library/fractions.rst
index 410b176..d8796de 100644
--- a/Doc/library/fractions.rst
+++ b/Doc/library/fractions.rst
@@ -35,7 +35,7 @@ another rational number, or from a string.
Assumed, that the :meth:`!as_integer_ratio` method returns a pair
of coprime integers and last one is positive.
Note that due to the
- usual issues with binary floating-point (see :ref:`tut-fp-issues`), the
+ usual issues with binary point (see :ref:`tut-fp-issues`), the
argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so
``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might expect.
(But see the documentation for the :meth:`limit_denominator` method below.)
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 83a15b2..2c64937 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -57,7 +57,7 @@ are always available. They are listed here in alphabetical order.
.. function:: abs(x)
Return the absolute value of a number. The argument may be an
- integer, a floating point number, or an object implementing
+ integer, a floating-point number, or an object implementing
:meth:`~object.__abs__`.
If the argument is a complex number, its magnitude is returned.
@@ -544,7 +544,7 @@ are always available. They are listed here in alphabetical order.
Take two (non-complex) numbers as arguments and return a pair of numbers
consisting of their quotient and remainder when using integer division. With
mixed operand types, the rules for binary arithmetic operators apply. For
- integers, the result is the same as ``(a // b, a % b)``. For floating point
+ integers, the result is the same as ``(a // b, a % b)``. For floating-point
numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a /
b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very
close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0
@@ -740,7 +740,7 @@ are always available. They are listed here in alphabetical order.
single: NaN
single: Infinity
- Return a floating point number constructed from a number or a string.
+ Return a floating-point number constructed from a number or a string.
Examples:
@@ -781,8 +781,8 @@ are always available. They are listed here in alphabetical order.
Case is not significant, so, for example, "inf", "Inf", "INFINITY", and
"iNfINity" are all acceptable spellings for positive infinity.
- Otherwise, if the argument is an integer or a floating point number, a
- floating point number with the same value (within Python's floating point
+ Otherwise, if the argument is an integer or a floating-point number, a
+ floating-point number with the same value (within Python's floating-point
precision) is returned. If the argument is outside the range of a Python
float, an :exc:`OverflowError` will be raised.
@@ -1010,7 +1010,7 @@ are always available. They are listed here in alphabetical order.
If the argument defines :meth:`~object.__int__`,
``int(x)`` returns ``x.__int__()``. If the argument defines
:meth:`~object.__index__`, it returns ``x.__index__()``.
- For floating point numbers, this truncates towards zero.
+ For floating-point numbers, this truncates towards zero.
If the argument is not a number or if *base* is given, then it must be a string,
:class:`bytes`, or :class:`bytearray` instance representing an integer
@@ -1928,7 +1928,7 @@ are always available. They are listed here in alphabetical order.
For some use cases, there are good alternatives to :func:`sum`.
The preferred, fast way to concatenate a sequence of strings is by calling
- ``''.join(sequence)``. To add floating point values with extended precision,
+ ``''.join(sequence)``. To add floating-point values with extended precision,
see :func:`math.fsum`\. To concatenate a series of iterables, consider using
:func:`itertools.chain`.
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 1fdd00a..553abf7 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -337,7 +337,7 @@ loops that truncate the stream.
yield n
n += step
- When counting with floating point numbers, better accuracy can sometimes be
+ When counting with floating-point numbers, better accuracy can sometimes be
achieved by substituting multiplicative code such as: ``(start + step * i
for i in count())``.
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 0a8cbd4..0246f99 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -424,7 +424,7 @@ The :mod:`locale` module defines the following exception and functions:
.. function:: format_string(format, val, grouping=False, monetary=False)
Formats a number *val* according to the current :const:`LC_NUMERIC` setting.
- The format follows the conventions of the ``%`` operator. For floating point
+ The format follows the conventions of the ``%`` operator. For floating-point
values, the decimal point is modified if appropriate. If *grouping* is ``True``,
also takes the grouping into account.
@@ -455,7 +455,7 @@ The :mod:`locale` module defines the following exception and functions:
.. function:: str(float)
- Formats a floating point number using the same format as the built-in function
+ Formats a floating-point number using the same format as the built-in function
``str(float)``, but takes the decimal point into account.
diff --git a/Doc/library/marshal.rst b/Doc/library/marshal.rst
index f9ba4d5..9e4606d 100644
--- a/Doc/library/marshal.rst
+++ b/Doc/library/marshal.rst
@@ -42,8 +42,8 @@ supports a substantially wider range of objects than marshal.
Not all Python object types are supported; in general, only objects whose value
is independent from a particular invocation of Python can be written and read by
-this module. The following types are supported: booleans, integers, floating
-point numbers, complex numbers, strings, bytes, bytearrays, tuples, lists, sets,
+this module. The following types are supported: booleans, integers, floating-point
+numbers, complex numbers, strings, bytes, bytearrays, tuples, lists, sets,
frozensets, dictionaries, and code objects (if *allow_code* is true),
where it should be understood that
tuples, lists, sets, frozensets and dictionaries are only supported as long as
@@ -142,7 +142,7 @@ In addition, the following constants are defined:
Indicates the format that the module uses. Version 0 is the historical
format, version 1 shares interned strings and version 2 uses a binary format
- for floating point numbers.
+ for floating-point numbers.
Version 3 adds support for object instancing and recursion.
The current version is 4.
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index 3161449..dd2ba41 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -123,7 +123,7 @@ Number-theoretic and representation functions
.. function:: fsum(iterable)
- Return an accurate floating point sum of values in the iterable. Avoids
+ Return an accurate floating-point sum of values in the iterable. Avoids
loss of precision by tracking multiple intermediate partial sums.
The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the
@@ -133,7 +133,7 @@ Number-theoretic and representation functions
least significant bit.
For further discussion and two alternative approaches, see the `ASPN cookbook
- recipes for accurate floating point summation
+ recipes for accurate floating-point summation
<https://code.activestate.com/recipes/393090-binary-floating-point-summation-accurate-to-full-p/>`_\.
@@ -304,7 +304,7 @@ Number-theoretic and representation functions
If the result of the remainder operation is zero, that zero will have
the same sign as *x*.
- On platforms using IEEE 754 binary floating-point, the result of this
+ On platforms using IEEE 754 binary floating point, the result of this
operation is always exactly representable: no rounding error is introduced.
.. versionadded:: 3.7
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 52487b4..ac24bf0 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -201,14 +201,14 @@ the :mod:`glob` module.)
.. function:: getatime(path)
- Return the time of last access of *path*. The return value is a floating point number giving
+ Return the time of last access of *path*. The return value is a floating-point number giving
the number of seconds since the epoch (see the :mod:`time` module). Raise
:exc:`OSError` if the file does not exist or is inaccessible.
.. function:: getmtime(path)
- Return the time of last modification of *path*. The return value is a floating point number
+ Return the time of last modification of *path*. The return value is a floating-point number
giving the number of seconds since the epoch (see the :mod:`time` module).
Raise :exc:`OSError` if the file does not exist or is inaccessible.
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index d7940b3..3334833 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -682,7 +682,7 @@ you are using :class:`profile.Profile` or :class:`cProfile.Profile`,
that you choose (see :ref:`profile-calibration`). For most machines, a timer
that returns a lone integer value will provide the best results in terms of
low overhead during profiling. (:func:`os.times` is *pretty* bad, as it
- returns a tuple of floating point values). If you want to substitute a
+ returns a tuple of floating-point values). If you want to substitute a
better timer in the cleanest fashion, derive a class and hardwire a
replacement dispatch method that best handles your timer call, along with the
appropriate calibration constant.
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index 755d1c8..c7f6b0b 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -200,8 +200,8 @@ Functions for sequences
For a given seed, the :func:`choices` function with equal weighting
typically produces a different sequence than repeated calls to
- :func:`choice`. The algorithm used by :func:`choices` uses floating
- point arithmetic for internal consistency and speed. The algorithm used
+ :func:`choice`. The algorithm used by :func:`choices` uses floating-point
+ arithmetic for internal consistency and speed. The algorithm used
by :func:`choice` defaults to integer arithmetic with repeated selections
to avoid small biases from round-off error.
@@ -298,12 +298,12 @@ be found in any statistics text.
.. function:: random()
- Return the next random floating point number in the range ``0.0 <= X < 1.0``
+ Return the next random floating-point number in the range ``0.0 <= X < 1.0``
.. function:: uniform(a, b)
- Return a random floating point number *N* such that ``a <= N <= b`` for
+ Return a random floating-point number *N* such that ``a <= N <= b`` for
``a <= b`` and ``b <= N <= a`` for ``b < a``.
The end-point value ``b`` may or may not be included in the range
@@ -313,7 +313,7 @@ be found in any statistics text.
.. function:: triangular(low, high, mode)
- Return a random floating point number *N* such that ``low <= N <= high`` and
+ Return a random floating-point number *N* such that ``low <= N <= high`` and
with the specified *mode* between those bounds. The *low* and *high* bounds
default to zero and one. The *mode* argument defaults to the midpoint
between the bounds, giving a symmetric distribution.
@@ -741,7 +741,7 @@ The following options are accepted:
.. option:: -f <N>
--float <N>
- Print a random floating point number between 1 and N inclusive,
+ Print a random floating-point number between 1 and N inclusive,
using :meth:`uniform`.
If no options are given, the output depends on the input:
diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst
index dd80b1e..0515d20 100644
--- a/Doc/library/resource.rst
+++ b/Doc/library/resource.rst
@@ -305,7 +305,7 @@ These functions are used to retrieve resource usage information:
elements.
The fields :attr:`ru_utime` and :attr:`ru_stime` of the return value are
- floating point values representing the amount of time spent executing in user
+ floating-point values representing the amount of time spent executing in user
mode and the amount of time spent executing in system mode, respectively. The
remaining values are integers. Consult the :manpage:`getrusage(2)` man page for
detailed information about these values. A brief summary is presented here:
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index 06ebaf0..f23a249 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -129,7 +129,7 @@ The module defines the following:
Empty iterables are allowed, but acceptance of three empty iterables is
platform-dependent. (It is known to work on Unix but not on Windows.) The
- optional *timeout* argument specifies a time-out as a floating point number
+ optional *timeout* argument specifies a time-out as a floating-point number
in seconds. When the *timeout* argument is omitted the function blocks until
at least one file descriptor is ready. A time-out value of zero specifies a
poll and never blocks.
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 782fb9b..b1e35e6 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1926,7 +1926,7 @@ to sockets.
.. method:: socket.settimeout(value)
Set a timeout on blocking socket operations. The *value* argument can be a
- nonnegative floating point number expressing seconds, or ``None``.
+ nonnegative floating-point number expressing seconds, or ``None``.
If a non-zero value is given, subsequent socket operations will raise a
:exc:`timeout` exception if the timeout period *value* has elapsed before
the operation has completed. If zero is given, the socket is put in
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst
index 8453135..f7051ae 100644
--- a/Doc/library/statistics.rst
+++ b/Doc/library/statistics.rst
@@ -73,7 +73,7 @@ or sample.
======================= ===============================================================
:func:`mean` Arithmetic mean ("average") of data.
-:func:`fmean` Fast, floating point arithmetic mean, with optional weighting.
+:func:`fmean` Fast, floating-point arithmetic mean, with optional weighting.
:func:`geometric_mean` Geometric mean of data.
:func:`harmonic_mean` Harmonic mean of data.
:func:`kde` Estimate the probability density distribution of the data.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index b74cd90..b44ac69 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -209,18 +209,18 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex`
pair: object; numeric
pair: object; Boolean
pair: object; integer
- pair: object; floating point
+ pair: object; floating-point
pair: object; complex number
pair: C; language
-There are three distinct numeric types: :dfn:`integers`, :dfn:`floating
-point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a
-subtype of integers. Integers have unlimited precision. Floating point
+There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point
+numbers`, and :dfn:`complex numbers`. In addition, Booleans are a
+subtype of integers. Integers have unlimited precision. Floating-point
numbers are usually implemented using :c:expr:`double` in C; information
-about the precision and internal representation of floating point
+about the precision and internal representation of floating-point
numbers for the machine on which your program is running is available
in :data:`sys.float_info`. Complex numbers have a real and imaginary
-part, which are each a floating point number. To extract these parts
+part, which are each a floating-point number. To extract these parts
from a complex number *z*, use ``z.real`` and ``z.imag``. (The standard
library includes the additional numeric types :mod:`fractions.Fraction`, for
rationals, and :mod:`decimal.Decimal`, for floating-point numbers with
@@ -229,7 +229,7 @@ user-definable precision.)
.. index::
pair: numeric; literals
pair: integer; literals
- pair: floating point; literals
+ pair: floating-point; literals
pair: complex number; literals
pair: hexadecimal; literals
pair: octal; literals
@@ -238,7 +238,7 @@ user-definable precision.)
Numbers are created by numeric literals or as the result of built-in functions
and operators. Unadorned integer literals (including hex, octal and binary
numbers) yield integers. Numeric literals containing a decimal point or an
-exponent sign yield floating point numbers. Appending ``'j'`` or ``'J'`` to a
+exponent sign yield floating-point numbers. Appending ``'j'`` or ``'J'`` to a
numeric literal yields an imaginary number (a complex number with a zero real
part) which you can add to an integer or float to get a complex number with real
and imaginary parts.
@@ -627,10 +627,10 @@ class`. float also has the following additional methods.
.. classmethod:: float.from_number(x)
- Class method to return a floating point number constructed from a number *x*.
+ Class method to return a floating-point number constructed from a number *x*.
- If the argument is an integer or a floating point number, a
- floating point number with the same value (within Python's floating point
+ If the argument is an integer or a floating-point number, a
+ floating-point number with the same value (within Python's floating-point
precision) is returned. If the argument is outside the range of a Python
float, an :exc:`OverflowError` will be raised.
@@ -1533,8 +1533,8 @@ objects that compare equal might have different :attr:`~range.start`,
.. seealso::
* The `linspace recipe <https://code.activestate.com/recipes/579000-equally-spaced-numbers-linspace/>`_
- shows how to implement a lazy version of range suitable for floating
- point applications.
+ shows how to implement a lazy version of range suitable for floating-point
+ applications.
.. index::
single: string; text sequence type
@@ -2478,19 +2478,19 @@ The conversion types are:
+------------+-----------------------------------------------------+-------+
| ``'X'`` | Signed hexadecimal (uppercase). | \(2) |
+------------+-----------------------------------------------------+-------+
-| ``'e'`` | Floating point exponential format (lowercase). | \(3) |
+| ``'e'`` | Floating-point exponential format (lowercase). | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'E'`` | Floating point exponential format (uppercase). | \(3) |
+| ``'E'`` | Floating-point exponential format (uppercase). | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'f'`` | Floating point decimal format. | \(3) |
+| ``'f'`` | Floating-point decimal format. | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'F'`` | Floating point decimal format. | \(3) |
+| ``'F'`` | Floating-point decimal format. | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'g'`` | Floating point format. Uses lowercase exponential | \(4) |
+| ``'g'`` | Floating-point format. Uses lowercase exponential | \(4) |
| | format if exponent is less than -4 or not less than | |
| | precision, decimal format otherwise. | |
+------------+-----------------------------------------------------+-------+
-| ``'G'`` | Floating point format. Uses uppercase exponential | \(4) |
+| ``'G'`` | Floating-point format. Uses uppercase exponential | \(4) |
| | format if exponent is less than -4 or not less than | |
| | precision, decimal format otherwise. | |
+------------+-----------------------------------------------------+-------+
@@ -3697,19 +3697,19 @@ The conversion types are:
+------------+-----------------------------------------------------+-------+
| ``'X'`` | Signed hexadecimal (uppercase). | \(2) |
+------------+-----------------------------------------------------+-------+
-| ``'e'`` | Floating point exponential format (lowercase). | \(3) |
+| ``'e'`` | Floating-point exponential format (lowercase). | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'E'`` | Floating point exponential format (uppercase). | \(3) |
+| ``'E'`` | Floating-point exponential format (uppercase). | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'f'`` | Floating point decimal format. | \(3) |
+| ``'f'`` | Floating-point decimal format. | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'F'`` | Floating point decimal format. | \(3) |
+| ``'F'`` | Floating-point decimal format. | \(3) |
+------------+-----------------------------------------------------+-------+
-| ``'g'`` | Floating point format. Uses lowercase exponential | \(4) |
+| ``'g'`` | Floating-point format. Uses lowercase exponential | \(4) |
| | format if exponent is less than -4 or not less than | |
| | precision, decimal format otherwise. | |
+------------+-----------------------------------------------------+-------+
-| ``'G'`` | Floating point format. Uses uppercase exponential | \(4) |
+| ``'G'`` | Floating-point format. Uses uppercase exponential | \(4) |
| | format if exponent is less than -4 or not less than | |
| | precision, decimal format otherwise. | |
+------------+-----------------------------------------------------+-------+
@@ -3931,7 +3931,7 @@ copying.
>>> a == b
False
- Note that, as with floating point numbers, ``v is w`` does *not* imply
+ Note that, as with floating-point numbers, ``v is w`` does *not* imply
``v == w`` for memoryview objects.
.. versionchanged:: 3.3
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index c3c0d73..1f31630 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -418,7 +418,7 @@ instead.
.. index:: single: _ (underscore); in string formatting
The ``'_'`` option signals the use of an underscore for a thousands
-separator for floating point presentation types and for integer
+separator for floating-point presentation types and for integer
presentation type ``'d'``. For integer presentation types ``'b'``,
``'o'``, ``'x'``, and ``'X'``, underscores will be inserted every 4
digits. For other presentation types, specifying this option is an
@@ -491,9 +491,9 @@ The available integer presentation types are:
+---------+----------------------------------------------------------+
In addition to the above presentation types, integers can be formatted
-with the floating point presentation types listed below (except
+with the floating-point presentation types listed below (except
``'n'`` and ``None``). When doing so, :func:`float` is used to convert the
-integer to a floating point number before formatting.
+integer to a floating-point number before formatting.
The available presentation types for :class:`float` and
:class:`~decimal.Decimal` values are:
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 7b259e2..49c2b9b 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -412,7 +412,7 @@ since it is impossible to detect the termination of alien threads.
timeout occurs.
When the *timeout* argument is present and not ``None``, it should be a
- floating point number specifying a timeout for the operation in seconds
+ floating-point number specifying a timeout for the operation in seconds
(or fractions thereof). As :meth:`~Thread.join` always returns ``None``,
you must call :meth:`~Thread.is_alive` after :meth:`~Thread.join` to
decide whether a timeout happened -- if the thread is still alive, the
@@ -794,7 +794,7 @@ item to the buffer only needs to wake up one consumer thread.
occurs. Once awakened or timed out, it re-acquires the lock and returns.
When the *timeout* argument is present and not ``None``, it should be a
- floating point number specifying a timeout for the operation in seconds
+ floating-point number specifying a timeout for the operation in seconds
(or fractions thereof).
When the underlying lock is an :class:`RLock`, it is not released using
@@ -1021,7 +1021,7 @@ method. The :meth:`~Event.wait` method blocks until the flag is true.
the the internal flag did not become true within the given wait time.
When the timeout argument is present and not ``None``, it should be a
- floating point number specifying a timeout for the operation in seconds,
+ floating-point number specifying a timeout for the operation in seconds,
or fractions thereof.
.. versionchanged:: 3.1
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index 4d76617..900e78d 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -69,7 +69,7 @@ An explanation of some terminology and conventions is in order.
systems, the clock "ticks" only 50 or 100 times a second.
* On the other hand, the precision of :func:`.time` and :func:`sleep` is better
- than their Unix equivalents: times are expressed as floating point numbers,
+ than their Unix equivalents: times are expressed as floating-point numbers,
:func:`.time` returns the most accurate time available (using Unix
:c:func:`!gettimeofday` where available), and :func:`sleep` will accept a time
with a nonzero fraction (Unix :c:func:`!select` is used to implement this, where
@@ -273,7 +273,7 @@ Functions
This is the inverse function of :func:`localtime`. Its argument is the
:class:`struct_time` or full 9-tuple (since the dst flag is needed; use ``-1``
as the dst flag if it is unknown) which expresses the time in *local* time, not
- UTC. It returns a floating point number, for compatibility with :func:`.time`.
+ UTC. It returns a floating-point number, for compatibility with :func:`.time`.
If the input value cannot be represented as a valid time, either
:exc:`OverflowError` or :exc:`ValueError` will be raised (which depends on
whether the invalid value is caught by Python or the underlying C libraries).
@@ -376,7 +376,7 @@ Functions
.. function:: sleep(secs)
Suspend execution of the calling thread for the given number of seconds.
- The argument may be a floating point number to indicate a more precise sleep
+ The argument may be a floating-point number to indicate a more precise sleep
time.
If the sleep is interrupted by a signal and no exception is raised by the
@@ -665,13 +665,13 @@ Functions
.. function:: time() -> float
- Return the time in seconds since the epoch_ as a floating point
+ Return the time in seconds since the epoch_ as a floating-point
number. The handling of `leap seconds`_ is platform dependent.
On Windows and most Unix systems, the leap seconds are not counted towards
the time in seconds since the epoch_. This is commonly referred to as `Unix
time <https://en.wikipedia.org/wiki/Unix_time>`_.
- Note that even though the time is always returned as a floating point
+ Note that even though the time is always returned as a floating-point
number, not all systems provide time with a better precision than 1 second.
While this function normally returns non-decreasing values, it can return a
lower value than a previous call if the system clock has been set back
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 34d8bbe..144c6f7 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -218,7 +218,7 @@ properties:
* A sign is shown only when the number is negative.
-Python distinguishes between integers, floating point numbers, and complex
+Python distinguishes between integers, floating-point numbers, and complex
numbers:
@@ -262,18 +262,18 @@ Booleans (:class:`bool`)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. index::
- pair: object; floating point
- pair: floating point; number
+ pair: object; floating-point
+ pair: floating-point; number
pair: C; language
pair: Java; language
-These represent machine-level double precision floating point numbers. You are
+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
+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.
+language with two kinds of floating-point numbers.
:class:`numbers.Complex` (:class:`complex`)
@@ -284,7 +284,7 @@ language with two kinds of floating point numbers.
pair: complex; number
These represent complex numbers as a pair of machine-level double precision
-floating point numbers. The same caveats apply as for floating point numbers.
+floating-point numbers. The same caveats apply as for floating-point numbers.
The real and imaginary parts of a complex number ``z`` can be retrieved through
the read-only attributes ``z.real`` and ``z.imag``.
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index cfada6e..dc1cd20 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -33,7 +33,7 @@ implementation for built-in types works as follows:
* If either argument is a complex number, the other is converted to complex;
-* otherwise, if either argument is a floating point number, the other is
+* otherwise, if either argument is a floating-point number, the other is
converted to floating point;
* otherwise, both must be integers and no conversion is necessary.
@@ -139,8 +139,8 @@ Python supports string and bytes literals and various numeric literals:
: | `integer` | `floatnumber` | `imagnumber`
Evaluation of a literal yields an object of the given type (string, bytes,
-integer, floating point number, complex number) with the given value. The value
-may be approximated in the case of floating point and imaginary (complex)
+integer, floating-point number, complex number) with the given value. The value
+may be approximated in the case of floating-point and imaginary (complex)
literals. See section :ref:`literals` for details.
.. index::
@@ -1361,7 +1361,7 @@ The floor division operation can be customized using the special
The ``%`` (modulo) operator yields the remainder from the division of the first
argument by the second. The numeric arguments are first converted to a common
type. A zero right argument raises the :exc:`ZeroDivisionError` exception. The
-arguments may be floating point numbers, e.g., ``3.14%0.7`` equals ``0.34``
+arguments may be floating-point numbers, e.g., ``3.14%0.7`` equals ``0.34``
(since ``3.14`` equals ``4*0.7 + 0.34``.) The modulo operator always yields a
result with the same sign as its second operand (or zero); the absolute value of
the result is strictly smaller than the absolute value of the second operand
@@ -1381,8 +1381,8 @@ The *modulo* operation can be customized using the special :meth:`~object.__mod_
and :meth:`~object.__rmod__` methods.
The floor division operator, the modulo operator, and the :func:`divmod`
-function are not defined for complex numbers. Instead, convert to a floating
-point number using the :func:`abs` function if appropriate.
+function are not defined for complex numbers. Instead, convert to a
+floating-point number using the :func:`abs` function if appropriate.
.. index::
single: addition
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 41ea89f..594fc71 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -879,10 +879,10 @@ Numeric literals
----------------
.. index:: number, numeric literal, integer literal
- floating point literal, hexadecimal literal
+ floating-point literal, hexadecimal literal
octal literal, binary literal, decimal literal, imaginary literal, complex literal
-There are three types of numeric literals: integers, floating point numbers, and
+There are three types of numeric literals: integers, floating-point numbers, and
imaginary numbers. There are no complex literals (complex numbers can be formed
by adding a real number and an imaginary number).
@@ -943,10 +943,10 @@ Some examples of integer literals::
single: _ (underscore); in numeric literal
.. _floating:
-Floating point literals
+Floating-point literals
-----------------------
-Floating point literals are described by the following lexical definitions:
+Floating-point literals are described by the following lexical definitions:
.. productionlist:: python-grammar
floatnumber: `pointfloat` | `exponentfloat`
@@ -958,10 +958,10 @@ Floating point literals are described by the following lexical definitions:
Note that the integer and exponent parts are always interpreted using radix 10.
For example, ``077e010`` is legal, and denotes the same number as ``77e10``. The
-allowed range of floating point literals is implementation-dependent. As in
+allowed range of floating-point literals is implementation-dependent. As in
integer literals, underscores are supported for digit grouping.
-Some examples of floating point literals::
+Some examples of floating-point literals::
3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93
@@ -982,9 +982,9 @@ Imaginary literals are described by the following lexical definitions:
imagnumber: (`floatnumber` | `digitpart`) ("j" | "J")
An imaginary literal yields a complex number with a real part of 0.0. Complex
-numbers are represented as a pair of floating point numbers and have the same
+numbers are represented as a pair of floating-point numbers and have the same
restrictions on their range. To create a complex number with a nonzero real
-part, add a floating point number to it, e.g., ``(3+4j)``. Some examples of
+part, add a floating-point number to it, e.g., ``(3+4j)``. Some examples of
imaginary literals::
3.14j 10.j 10j .001j 1e100j 3.14e-10j 3.14_15_93j
diff --git a/Doc/tutorial/floatingpoint.rst b/Doc/tutorial/floatingpoint.rst
index 0795e2f..6093028 100644
--- a/Doc/tutorial/floatingpoint.rst
+++ b/Doc/tutorial/floatingpoint.rst
@@ -6,7 +6,7 @@
.. _tut-fp-issues:
**************************************************
-Floating Point Arithmetic: Issues and Limitations
+Floating-Point Arithmetic: Issues and Limitations
**************************************************
.. sectionauthor:: Tim Peters <tim_one@users.sourceforge.net>
@@ -88,7 +88,7 @@ the one with 17 significant digits, ``0.10000000000000001``. Starting with
Python 3.1, Python (on most systems) is now able to choose the shortest of
these and simply display ``0.1``.
-Note that this is in the very nature of binary floating-point: this is not a bug
+Note that this is in the very nature of binary floating point: this is not a bug
in Python, and it is not a bug in your code either. You'll see the same kind of
thing in all languages that support your hardware's floating-point arithmetic
(although some languages may not *display* the difference by default, or in all
@@ -148,13 +148,13 @@ Binary floating-point arithmetic holds many surprises like this. The problem
with "0.1" is explained in precise detail below, in the "Representation Error"
section. See `Examples of Floating Point Problems
<https://jvns.ca/blog/2023/01/13/examples-of-floating-point-problems/>`_ for
-a pleasant summary of how binary floating-point works and the kinds of
+a pleasant summary of how binary floating point works and the kinds of
problems commonly encountered in practice. Also see
`The Perils of Floating Point <http://www.indowsway.com/floatingpoint.htm>`_
for a more complete account of other common surprises.
As that says near the end, "there are no easy answers." Still, don't be unduly
-wary of floating-point! The errors in Python float operations are inherited
+wary of floating point! The errors in Python float operations are inherited
from the floating-point hardware, and on most machines are on the order of no
more than 1 part in 2\*\*53 per operation. That's more than adequate for most
tasks, but you do need to keep in mind that it's not decimal arithmetic and
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 0f16dae..3ead346 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -62,7 +62,7 @@ For example::
20
>>> (50 - 5*6) / 4
5.0
- >>> 8 / 5 # division always returns a floating point number
+ >>> 8 / 5 # division always returns a floating-point number
1.6
The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`,
@@ -544,7 +544,7 @@ This example introduces several new features.
* The :func:`print` function writes the value of the argument(s) it is given.
It differs from just writing the expression you want to write (as we did
earlier in the calculator examples) in the way it handles multiple arguments,
- floating point quantities, and strings. Strings are printed without quotes,
+ floating-point quantities, and strings. Strings are printed without quotes,
and a space is inserted between items, so you can format things nicely, like
this::
diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst
index 86c9442..4b3eef3 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -138,7 +138,7 @@ Mathematics
===========
The :mod:`math` module gives access to the underlying C library functions for
-floating point math::
+floating-point math::
>>> import math
>>> math.cos(math.pi / 4)
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst
index 719f772..a2f96b3 100644
--- a/Doc/tutorial/stdlib2.rst
+++ b/Doc/tutorial/stdlib2.rst
@@ -352,11 +352,11 @@ not want to run a full list sort::
.. _tut-decimal-fp:
-Decimal Floating Point Arithmetic
+Decimal Floating-Point Arithmetic
=================================
The :mod:`decimal` module offers a :class:`~decimal.Decimal` datatype for
-decimal floating point arithmetic. Compared to the built-in :class:`float`
+decimal floating-point arithmetic. Compared to the built-in :class:`float`
implementation of binary floating point, the class is especially helpful for
* financial applications and other uses which require exact decimal
diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst
index 8eaba84..c765a29 100644
--- a/Doc/using/configure.rst
+++ b/Doc/using/configure.rst
@@ -16,8 +16,8 @@ Features and minimum versions required to build CPython:
* On Windows, Microsoft Visual Studio 2017 or later is required.
-* Support for `IEEE 754 <https://en.wikipedia.org/wiki/IEEE_754>`_ floating
- point numbers and `floating point Not-a-Number (NaN)
+* Support for `IEEE 754 <https://en.wikipedia.org/wiki/IEEE_754>`_
+ floating-point numbers and `floating-point Not-a-Number (NaN)
<https://en.wikipedia.org/wiki/NaN#Floating_point>`_.
* Support for threads.
diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst
index b4002f0..8eafb48 100644
--- a/Doc/whatsnew/2.1.rst
+++ b/Doc/whatsnew/2.1.rst
@@ -644,9 +644,9 @@ New and Improved Modules
lists the function arguments and the local variables for each frame.
* Various functions in the :mod:`time` module, such as :func:`~time.asctime` and
- :func:`~time.localtime`, require a floating point argument containing the time in
+ :func:`~time.localtime`, require a floating-point argument containing the time in
seconds since the epoch. The most common use of these functions is to work with
- the current time, so the floating point argument has been made optional; when a
+ the current time, so the floating-point argument has been made optional; when a
value isn't provided, the current time will be used. For example, log file
entries usually need a string containing the current time; in Python 2.1,
``time.asctime()`` can be used, instead of the lengthier
diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst
index d4dbe05..5db34fa 100644
--- a/Doc/whatsnew/2.2.rst
+++ b/Doc/whatsnew/2.2.rst
@@ -1249,7 +1249,7 @@ Some of the more notable changes are:
* The :func:`pow` built-in function no longer supports 3 arguments when
floating-point numbers are supplied. ``pow(x, y, z)`` returns ``(x**y) % z``,
- but this is never useful for floating point numbers, and the final result varies
+ but this is never useful for floating-point numbers, and the final result varies
unpredictably depending on the platform. A call such as ``pow(2.0, 8.0, 7.0)``
will now raise a :exc:`TypeError` exception.
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
index 8adf36e..80849ab 100644
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -1382,7 +1382,7 @@ complete list of changes, or look through the CVS logs for all the details.
In Python 2.4, the default will change to always returning floats.
Application developers should enable this feature only if all their libraries
- work properly when confronted with floating point time stamps, or if they use
+ work properly when confronted with floating-point time stamps, or if they use
the tuple API. If used, the feature should be activated on an application level
instead of trying to enable it on a per-use basis.
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index fc2de71..3650edb 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -3051,7 +3051,7 @@ Changes to Python's build process and to the C API include:
* Several functions return information about the platform's
floating-point support. :c:func:`PyFloat_GetMax` returns
- the maximum representable floating point value,
+ the maximum representable floating-point value,
and :c:func:`PyFloat_GetMin` returns the minimum
positive value. :c:func:`PyFloat_GetInfo` returns an object
containing more information from the :file:`float.h` file, such as
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index c45f088..857b6bb 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -1198,7 +1198,7 @@ changes, or look through the Subversion logs for all the details.
of the operands. Previously such comparisons would fall back to
Python's default rules for comparing objects, which produced arbitrary
results based on their type. Note that you still cannot combine
- :class:`!Decimal` and floating-point in other operations such as addition,
+ :class:`!Decimal` and floating point in other operations such as addition,
since you should be explicitly choosing how to convert between float and
:class:`!Decimal`. (Fixed by Mark Dickinson; :issue:`2531`.)
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst
index 69b273e..b9606be 100644
--- a/Doc/whatsnew/3.1.rst
+++ b/Doc/whatsnew/3.1.rst
@@ -205,9 +205,9 @@ Some smaller changes made to the core Python language are:
(Contributed by Mark Dickinson; :issue:`4707`.)
-* Python now uses David Gay's algorithm for finding the shortest floating
- point representation that doesn't change its value. This should help
- mitigate some of the confusion surrounding binary floating point
+* Python now uses David Gay's algorithm for finding the shortest floating-point
+ representation that doesn't change its value. This should help
+ mitigate some of the confusion surrounding binary floating-point
numbers.
The significance is easily seen with a number like ``1.1`` which does not
@@ -215,7 +215,7 @@ Some smaller changes made to the core Python language are:
equivalent, an expression like ``float('1.1')`` evaluates to the nearest
representable value which is ``0x1.199999999999ap+0`` in hex or
``1.100000000000000088817841970012523233890533447265625`` in decimal. That
- nearest value was and still is used in subsequent floating point
+ nearest value was and still is used in subsequent floating-point
calculations.
What is new is how the number gets displayed. Formerly, Python used a
@@ -224,7 +224,7 @@ Some smaller changes made to the core Python language are:
using 17 digits was that it relied on IEEE-754 guarantees to assure that
``eval(repr(1.1))`` would round-trip exactly to its original value. The
disadvantage is that many people found the output to be confusing (mistaking
- intrinsic limitations of binary floating point representation as being a
+ intrinsic limitations of binary floating-point representation as being a
problem with Python itself).
The new algorithm for ``repr(1.1)`` is smarter and returns ``'1.1'``.
@@ -236,8 +236,8 @@ Some smaller changes made to the core Python language are:
it does not change the underlying values. So, it is still the case that
``1.1 + 2.2 != 3.3`` even though the representations may suggest otherwise.
- The new algorithm depends on certain features in the underlying floating
- point implementation. If the required features are not found, the old
+ The new algorithm depends on certain features in the underlying floating-point
+ implementation. If the required features are not found, the old
algorithm will continue to be used. Also, the text pickle protocols
assure cross-platform portability by using the old algorithm.
@@ -550,7 +550,7 @@ Porting to Python 3.1
This section lists previously described changes and other bugfixes
that may require changes to your code:
-* The new floating point string representations can break existing doctests.
+* The new floating-point string representations can break existing doctests.
For example::
def e():
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index b601bd4..20a060d 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -2138,7 +2138,7 @@ Build Changes
:issue:`45440` and :issue:`46640`.)
* Support for `IEEE 754 <https://en.wikipedia.org/wiki/IEEE_754>`_
- floating point numbers.
+ floating-point numbers.
(Contributed by Victor Stinner in :issue:`46917`.)
* The :c:macro:`!Py_NO_NAN` macro has been removed.
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index a6b3820..ac05b59 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -1312,7 +1312,7 @@ An early decision to limit the interoperability of various numeric types has
been relaxed. It is still unsupported (and ill-advised) to have implicit
mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')``
because the latter loses information in the process of constructing the binary
-float. However, since existing floating point value can be converted losslessly
+float. However, since existing floating-point value can be converted losslessly
to either a decimal or rational representation, it makes sense to add them to
the constructor and to support mixed-type comparisons.
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index 29b4034..5df976d 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -1097,12 +1097,12 @@ decimal
C-module and libmpdec written by Stefan Krah.
The new C version of the decimal module integrates the high speed libmpdec
-library for arbitrary precision correctly rounded decimal floating point
+library for arbitrary precision correctly rounded decimal floating-point
arithmetic. libmpdec conforms to IBM's General Decimal Arithmetic Specification.
Performance gains range from 10x for database applications to 100x for
numerically intensive applications. These numbers are expected gains
-for standard precisions used in decimal floating point arithmetic. Since
+for standard precisions used in decimal floating-point arithmetic. Since
the precision is user configurable, the exact figures may vary. For example,
in integer bignum arithmetic the differences can be significantly higher.
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index 68ab434..35352c7 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -261,7 +261,7 @@ allowed.
The :ref:`string formatting <formatspec>` language also now has support
for the ``'_'`` option to signal the use of an underscore for a thousands
-separator for floating point presentation types and for integer
+separator for floating-point presentation types and for integer
presentation type ``'d'``. For integer presentation types ``'b'``,
``'o'``, ``'x'``, and ``'X'``, underscores will be inserted every 4
digits::
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index ae750cb..ab460ed 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -339,7 +339,7 @@ PEP 564: New Time Functions With Nanosecond Resolution
------------------------------------------------------
The resolution of clocks in modern systems can exceed the limited precision
-of a floating point number returned by the :func:`time.time` function
+of a floating-point number returned by the :func:`time.time` function
and its variants. To avoid loss of precision, :pep:`564` adds six new
"nanosecond" variants of the existing timer functions to the :mod:`time`
module:
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 1356f24..bf5e277 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -1192,7 +1192,7 @@ post-handshake authentication.
statistics
----------
-Added :func:`statistics.fmean` as a faster, floating point variant of
+Added :func:`statistics.fmean` as a faster, floating-point variant of
:func:`statistics.mean()`. (Contributed by Raymond Hettinger and
Steven D'Aprano in :issue:`35904`.)