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

lsr(-123, 0) not equiv. to -123 >>> 0 #7222

Open
leoliu opened this issue Jan 2, 2025 · 1 comment
Open

lsr(-123, 0) not equiv. to -123 >>> 0 #7222

leoliu opened this issue Jan 2, 2025 · 1 comment
Labels

Comments

@leoliu
Copy link

leoliu commented Jan 2, 2025

While converting a JS program to rescript I discovered that lsr(-123,0) is compiled to just -123 which is not equivalent to -123 >>> 0. I wonder if this is a bug?

https://rescript-lang.org/try?version=v11.1.4&module=esmodule&code=DYUwLgBAHhC8HAM4CcAUBaAjAJgMwBoAGASgChRIBPOCAUmQEMB3VAIizwgD4eJDWypAFKIAdMAD2Ac1QxY8SsSA

@shulhi shulhi added the bug label Jan 2, 2025
@jagadam97
Copy link

jagadam97 commented Jan 4, 2025

i think these #7171 enhancements will fix what ever issue we are having here.

But i found an inconstency from OCaml Lib here.

-123 lsr 0 is giving output equivalent to -123 >> 0
where as
-123 lsr 1 is giving output equivalent to -123 >>> 1

image

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

No branches or pull requests

3 participants