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

Fix math.floor() and math.ceil() #177

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

Bisht13
Copy link
Contributor

@Bisht13 Bisht13 commented Jul 8, 2022

This fixes the issue of math.floor() and math.ceil() giving nan for +inf and -inf.

Issue fixed #176

@zhuizhuhaomeng
Copy link
Contributor

@velemas would you please review this PR?

Copy link
Contributor

@velemas velemas left a comment

Choose a reason for hiding this comment

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

lgtm

@zhuizhuhaomeng zhuizhuhaomeng merged commit 89d53e9 into openresty:v2.1-agentzh Aug 31, 2022
@Bisht13 Bisht13 deleted the fix-math-func branch August 31, 2022 13:43
neuschaefer added a commit to neuschaefer/luajit2 that referenced this pull request Feb 11, 2025
The previous change[1] to this code left quite a bit of dead code
behind, when it switched vm_round from using DIDBR (divide to integer)
to FIDBR (load floating-point integer). Simplify the code by removing
the remains of the previous implementation.

As a side effect, math.ceil() etc. now execute without crashing in QEMU,
which was previously not the case because QEMU doesn't implement DIDBR.

[1]: openresty#177
neuschaefer added a commit to neuschaefer/luajit2 that referenced this pull request Feb 11, 2025
The previous change[1] to this code left quite a bit of dead code
behind, when it switched vm_round from using DIDBR (divide to integer)
to FIDBR (load floating-point integer). Simplify the code by removing
the remains of the previous implementation.

As a side effect, math.ceil() etc. now execute without crashing in QEMU,
which was previously not the case because QEMU doesn't implement DIDBR.

[1]: openresty#177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Math functions not working on s390x
3 participants