-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow numeric rounding to be 3...7 #6083
Conversation
Generated via commit 7e0c88f Download link for the artifact containing the test results: ↓ atime-results.zip Time taken to finish the standard R installation steps: 11 minutes and 52 seconds Time taken to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok, maybe user who requested that could test it...
cc @rmcgehee |
Not as easy as I'd hoped -- here's taken from test 1147.*: The behavior for names(x) = x
m = sapply(0:7, \(d) { setNumericRounding(d); names(x)[forderv(x)]})
rownames(m) = 1:nrow(m)
colnames(m) = 0:7
format(m, just='left')
# 0 1 2 3 4 5 6 7
# 1 "NA " "NA " "NA " "NA " "NA " "NA " "NA " "NA "
# 2 "NA " "NA " "NA " "NA " "NA " "NA " "NA " "NA "
# 3 "NaN " "NaN " "NaN " "NaN " "NaN " "NaN " "NaN " "NaN "
# 4 "NaN " "NaN " "NaN " "NaN " "NaN " "NaN " "NaN " "NaN "
# 5 "-Inf " "-Inf " "-Inf " "-Inf " "-Inf " "-Inf " "-Inf " "-Inf "
# 6 "-7.18918111 " "-7.18918111 " "-7.18918111 " "-7.18918111 " "5.18909000000002" "-7.18918 " "-7.18918 " "-7.18918 "
# 7 "-7.18918 " "-7.18918 " "-7.18918 " "-7.18918 " "5.18909 " "-7.18918111 " "-7.18918111 " "-7.18918111 "
# 8 "5.18908999999964" "5.18908999999964" "5.18909000000002" "5.18909000000002" "5.18908999999964" "5.18909000000002" "5.18909000000002" "8 "
# 9 "5.18908999999999" "5.18909000000002" "5.18909 " "5.18909 " "5.18908999999999" "5.18909 " "5.18909 " "5.18909000000002"
# 10 "5.18909 " "5.18909 " "5.18908999999964" "5.18908999999964" "8 " "5.18908999999964" "5.18908999999964" "5.18909 "
# 11 "5.18909000000002" "5.18908999999999" "5.18908999999999" "5.18908999999999" "-7.18918111 " "5.18908999999999" "5.18908999999999" "5.18908999999964"
# 12 "8 " "8 " "8 " "8 " "-7.18918 " "8 " "8 " "5.18908999999999"
# 13 "Inf " "Inf " "Inf " "Inf " "Inf " "Inf " "Inf " "Inf " |
Closed the issue with comment: |
Closes #1898
It's trivial enough to implement, I'm not 100% sure the best way to test it's WAI, esp. lacking MRE from original issue. Here's what I came up with:
with output:
Looks vaguely OK.
Q before proceeding to round out the PR is (1) if there's a good reason to limit
setNumericRounding<=2
(2) whether we should be much more careful about designing tests, e.g. working backwards from bit representations.