-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix nextpow
, prevpow
for types without typemax
#49669
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
Conversation
Note how the current version is consistent (+c), free of sideeffects (+e), always terminates (+t), doesn't access task local state (+s) and only uses memory inaccessible to other functions (+m). In contrast, the new version taints all these effects, making it non-constant foldable for all argument types. See I think it'll be better to write a specialized method for |
Oof, OK. I guess this means that |
No, Regardless, if performance for |
nextpow
, prevpow
for types without typemax
Ping. The failures are system-dependent and surely unrelated. |
@Seelengrab are your concerns resolved? |
If |
|
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue, revealed after fixing the previous one, was a missing `promote` for the arguments of a `mul_with_overflow` call. Fixes JuliaLang#57906
bump |
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue was a missing promote for the arguments of a `mul_with_overflow` call. Fixes #57906 (cherry picked from commit 3627a85)
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue was a missing promote for the arguments of a `mul_with_overflow` call. Fixes #57906 (cherry picked from commit 3627a85)
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue was a missing promote for the arguments of a `mul_with_overflow` call. Fixes #57906 (cherry picked from commit 3627a85)
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue was a missing promote for the arguments of a `mul_with_overflow` call. Fixes #57906 (cherry picked from commit 3627a85)
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue was a missing promote for the arguments of a `mul_with_overflow` call. Fixes #57906 (cherry picked from commit 3627a85)
Without this change
prevpow
andnextpow
fail for, e.g.,BigInt
; incorrectly throwing aMethodError
. For example, calls likeprevpow(3, big"10")
ornextpow(3, big"10")
fail.The issue is that the code incorrectly assumes the existence of a
typemax
method.Another issue was a missing promote for the arguments of a
mul_with_overflow
call.Fixes #57906