long to float conversion not choosing closest float
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the two Python reproductions in the issue and run the suspected CPython.test_statistics test_shift_data_exact test. Trace the implementation of long-to-float conversion and true division in the IronPython runtime. Done means the conversion chooses the closest float and both reproductions and the referenced statistics test pass.
Written by the indexing model from the issue text.
Description
It looks like it always chooses previous float, for example (this should fail!):
for i in range(100):
x = (1 << 56) + i
assert int(float(x)) <= x
This is causing true division of long values to yield imprecise results. For example, the following (see https://github.com/IronLanguages/ironpython3/issues/844#issuecomment-652968559) fails:
assert 151246562239730615230750785535999 / 7130534626283790383418955530240 == 21.211111111111112
This is probably causing the failures in test_shift_data_exact of CPython.test_statistics.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IronLanguages/ironpython3
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
IronLanguages/ironpython3#2073 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IronLanguages/ironpython3#2072 · 1 comment ·
-
module-os posix
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IronLanguages/ironpython3#2070 · 1 comment ·
-
What's New In Python 3.2
Difficulty 3/5 1-2 days Newbie friendliness 55/100
IronLanguages/ironpython3#2069 ·
-
module-re What's New In Python 3.7
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IronLanguages/ironpython3#2066 ·
All issues in IronLanguages/ironpython3
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·