Skip to content
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

faster iseven(::BigInt) #40850

Merged
merged 1 commit into from
May 18, 2021
Merged

faster iseven(::BigInt) #40850

merged 1 commit into from
May 18, 2021

Conversation

rfourquet
Copy link
Member

This method was depending on the generic implementation
iseven(x::Integer) = !isodd(x) for its efficiency, but this was removed
in #38976, making iseven(::BigInt) 30 times slower.

This method was depending on the generic implementation
`iseven(x::Integer) = !isodd(x)` for its efficiency, but this was removed
in #38976, making `iseven(::BigInt)` 30 times slower.
@rfourquet rfourquet added domain:maths Mathematical functions domain:bignums BigInt and BigFloat performance Must go faster labels May 17, 2021
@rfourquet rfourquet added this to the 1.7 milestone May 17, 2021
Copy link
Member

@oscardssmith oscardssmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@oscardssmith oscardssmith added the status:merge me PR is reviewed. Merge when all tests are passing label May 17, 2021
@rfourquet
Copy link
Member Author

Or should we define iseven(n::Real) = !isodd(n) instead?

@oscardssmith
Copy link
Member

IMO, either is fine.

@JeffBezanson JeffBezanson merged commit b054be5 into master May 18, 2021
@JeffBezanson JeffBezanson deleted the rf/iseven-bigint branch May 18, 2021 02:37
@dkarrasch dkarrasch removed the status:merge me PR is reviewed. Merge when all tests are passing label May 18, 2021
shirodkara pushed a commit to shirodkara/julia that referenced this pull request Jun 9, 2021
This method was depending on the generic implementation
`iseven(x::Integer) = !isodd(x)` for its efficiency, but this was removed
in JuliaLang#38976, making `iseven(::BigInt)` 30 times slower.
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
This method was depending on the generic implementation
`iseven(x::Integer) = !isodd(x)` for its efficiency, but this was removed
in JuliaLang#38976, making `iseven(::BigInt)` 30 times slower.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:bignums BigInt and BigFloat domain:maths Mathematical functions performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants