]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627) (#106633)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 Jul 2023 15:48:00 +0000 (08:48 -0700)
committerGitHub <noreply@github.com>
Tue, 11 Jul 2023 15:48:00 +0000 (15:48 +0000)
commitda15b12d8d7f4fec89d4e56f61799048b0590c95
treee29745ef0407ae6a67edc8cfd956b438e73404ea
parent318f6ae1cd3c5936062ff2d16fa4f3d1f38ea802
[3.11] gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627) (#106633)

gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627)

gh-86618 assumed a-b-c = a-(b+c) = a-d where d = b+d.
For floats 2.0, 1.0, and 0.9999999999999999, this assumption
is false.  The net change of 1.1102230246251565e-16 to 0.0
results in division by 0.  Revert the replacement.  Add test.
(cherry picked from commit a2d54d4e8ab12f967a220be88bde8ac8227c5ab3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Lib/colorsys.py
Lib/test/test_colorsys.py
Misc/NEWS.d/next/Library/2023-07-11-09-25-40.gh-issue-106530.VgXrMx.rst [new file with mode: 0644]