Skip to content

Optimize even?/odd? for big integers#6314

Merged
matz merged 2 commits into
mruby:masterfrom
hoshiumiarata:optimize_int_even
Jul 23, 2024
Merged

Optimize even?/odd? for big integers#6314
matz merged 2 commits into
mruby:masterfrom
hoshiumiarata:optimize_int_even

Conversation

@hoshiumiarata

Copy link
Copy Markdown
Contributor

Using mod for big integers leads to poor performance, so I replaced it with bitwise AND.

@hoshiumiarata hoshiumiarata requested a review from matz as a code owner July 23, 2024 12:13
@matz matz merged commit b4ffdde into mruby:master Jul 23, 2024
@matz

matz commented Jul 23, 2024

Copy link
Copy Markdown
Member

Thank you!

matz added a commit that referenced this pull request Jul 25, 2024
CRuby raises TypeError with float numbers as operands; ref #6314
matz added a commit that referenced this pull request Jul 25, 2024
Negative integers are virtually considered as 2's compliment of the
absolute value of the corresponding number. It means `-1` is considered
as infinite sequence of `1` toward msb side. ref #6314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants