As noted in issue #106498, the TODO comment and this patch were incorrect in that 2.0 - maxc - minc does not equal 2.0 - (maxc + minc) for maxc, minc = 1.0, 0.9999999999999999 because the float sum is 2.0, leaving 0.0 and causing ZeroDivisionError, whereas the correct subtraction leaves 1.1102230246251565e-16.
Activity
jjerphan commented on Nov 24, 2020
This issue has been created after the PR.
terryjreedy commented on Nov 28, 2020
New changeset f919531 by Julien Jerphanion in branch 'master':
bpo-42452: Improve colorsys.rgb_to_hls code (GH-23306)
f919531
terryjreedy commented on Nov 28, 2020
The change was a suggested TODO in the code itself.
terryjreedy commented on Jul 11, 2023
As noted in issue #106498, the TODO comment and this patch were incorrect in that 2.0 - maxc - minc does not equal 2.0 - (maxc + minc) for maxc, minc = 1.0, 0.9999999999999999 because the float sum is 2.0, leaving 0.0 and causing ZeroDivisionError, whereas the correct subtraction leaves 1.1102230246251565e-16.
pythongh-106498: Revert incorrect colorsys.rgb_to_hls change
gh-106498: Revert incorrect colorsys.rgb_to_hls change (#106627)
pythongh-106498: Revert incorrect colorsys.rgb_to_hls change (pythonG…
pythongh-106498: Revert incorrect colorsys.rgb_to_hls change (pythonG…
[3.12] gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627
[3.11] gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627