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

intdiv is not working properly. #422

Open
eduardoejp opened this issue Mar 11, 2021 · 4 comments · May be fixed by #425
Open

intdiv is not working properly. #422

eduardoejp opened this issue Mar 11, 2021 · 4 comments · May be fixed by #425
Assignees
Labels

Comments

@eduardoejp
Copy link

Currently:

intdiv(3315714752669, 10) === 15

This is incorrect, and it should be

intdiv(3315714752669, 10) === 331571475266
@nstdio nstdio added the bug label Dec 25, 2021
@nstdio nstdio self-assigned this Dec 25, 2021
@nstdio
Copy link
Member

nstdio commented Dec 25, 2021

Hi @eduardoejp , thanks for reporting this. Indeed, I managed to reproduce this wired the bug.

@nstdio nstdio linked a pull request Dec 25, 2021 that will close this issue
@nstdio
Copy link
Member

nstdio commented Dec 25, 2021

Here what is happen: the input gets casted to int because intdiv method implemented in Java accepts integers. So 3315714752669 became 157 after casting to int only then divided by 10 which gives actual result.

@eduardoejp
Copy link
Author

Given that JPHP seems to work fine with longs in general, can intdiv be made to work with longs so that it works correctly?

@nstdio
Copy link
Member

nstdio commented Dec 26, 2021

#425 should resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants