jphp icon indicating copy to clipboard operation
jphp copied to clipboard

intdiv is not working properly.

Open eduardoejp opened this issue 3 years ago • 4 comments

Currently:

intdiv(3315714752669, 10) === 15

This is incorrect, and it should be

intdiv(3315714752669, 10) === 331571475266

eduardoejp avatar Mar 11 '21 20:03 eduardoejp

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

nstdio avatar Dec 25 '21 13:12 nstdio

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.

nstdio avatar Dec 25 '21 13:12 nstdio

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

eduardoejp avatar Dec 25 '21 17:12 eduardoejp

#425 should resolve the issue.

nstdio avatar Dec 26 '21 17:12 nstdio