Skip to content

Fix int_xor to call flo_xor.#6197

Merged
matz merged 1 commit intomruby:masterfrom
niyarin:fix/call-flo_xor
Mar 11, 2024
Merged

Fix int_xor to call flo_xor.#6197
matz merged 1 commit intomruby:masterfrom
niyarin:fix/call-flo_xor

Conversation

@niyarin
Copy link
Copy Markdown
Contributor

@niyarin niyarin commented Mar 10, 2024

This PR fixes the problem that flo_xor is not called from int_xor.

Code like the following works as expected:

10^2.0
=> 10 #expected 8

@niyarin niyarin requested a review from matz as a code owner March 10, 2024 03:25
@github-actions github-actions bot added the core label Mar 10, 2024
@matz
Copy link
Copy Markdown
Member

matz commented Mar 11, 2024

Thank you for the PR. You have found a long-lived bug.
I noticed CRuby raises exceptions for bit-operations with integers and floats.
Maybe we should fix the issue differently.

@matz
Copy link
Copy Markdown
Member

matz commented Mar 11, 2024

I remember that mruby used to use float numbers when integers overflowed before it provided big integers.
We implemented big integers, so bit operations for float numbers should be removed.

@matz matz merged commit 39e3db2 into mruby:master Mar 11, 2024
matz added a commit that referenced this pull request Mar 11, 2024
mruby used to use float numbers for overflown integers before we
implemented big integers. Now we don't need bit operations for float
numbers anymore. Also removed tests for shift operations for float
numbers.
@niyarin niyarin deleted the fix/call-flo_xor branch March 11, 2024 07:48
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