Skip to content

Commit 5add3a3

Browse files
committed
Add NEWS and whatsnew entry for Ryū float repr
1 parent ff42a55 commit 5add3a3

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Doc/whatsnew/3.15.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,12 @@ zlib
13611361
Optimizations
13621362
=============
13631363

1364+
* :func:`repr` and :func:`str` of :class:`float` and :class:`complex` values
1365+
are now several times faster, using the Ryū algorithm for shortest
1366+
float-to-string conversion in place of arbitrary-precision arithmetic.
1367+
The output is unchanged.
1368+
(Contributed by Gregory P. Smith in :gh:`00000`.)
1369+
13641370
* ``mimalloc`` is now used as the default allocator for
13651371
for raw memory allocations such as via :c:func:`PyMem_RawMalloc`
13661372
for better performance on :term:`free-threaded builds <free-threaded build>`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:func:`repr` and :func:`str` of :class:`float` and :class:`complex` values
2+
are now several times faster. The shortest-representation conversion now
3+
uses the Ryū algorithm with a fixed-size lookup table instead of the
4+
arbitrary-precision arithmetic in David Gay's ``dtoa``. The output is
5+
unchanged.

0 commit comments

Comments
 (0)