-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ndigits(big(0), 1)
does not raise an error
#16766
Comments
Also |
Shouldn't bases -1, 0 and 1 all give errors? |
There may be an argument to be made that |
iiuc base |
cf. https://en.wikipedia.org/wiki/Non-standard_positional_numeral_systems for an idea why |
We would need to have a |
See #16766. `ndigits(big(0),1)` doesn't raise an error, but we were sometimes (randomly, rarely) testing that it does. This change makes the test reliable. The issue of how this case should actually behave is still open.
See JuliaLang#16766. `ndigits(big(0),1)` doesn't raise an error, but we were sometimes (randomly, rarely) testing that it does. This change makes the test reliable. The issue of how this case should actually behave is still open.
See JuliaLang#16766. `ndigits(big(0),1)` doesn't raise an error, but we were sometimes (randomly, rarely) testing that it does. This change makes the test reliable. The issue of how this case should actually behave is still open.
What does a negative base mean? |
Negative bases are a real thing, e.g. negabinary. Since I believe there's only one thing they can mean, we might want to just support them correctly. But clearly it's not a high priority. |
Okay, but that isn't documented anywhere, nor are they supported by the |
ndigits: check for invalid bases (fix #16766)
I'm not sure if it should but it is in the test and I've just triggered it once while stress testing #13995 .
Either way, the test needs to be fixed with explicit test for this case added. The implementation possibly needs fixing too if an error is desired.
The text was updated successfully, but these errors were encountered: