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

truncate fails at compile-time for 32-bits #144

Open
arnetheduck opened this issue Sep 27, 2023 · 0 comments
Open

truncate fails at compile-time for 32-bits #144

arnetheduck opened this issue Sep 27, 2023 · 0 comments

Comments

@arnetheduck
Copy link
Member

    let a = -1_000_000.stint(64)
    let b = 1_000_000.stint(64)

    check:
      when sizeof(int) == 8:
        truncate(a*b, int64) == -1_000_000_000_000'i64 # need 40 bits
        truncate(b*a, int64) == -1_000_000_000_000'i64
nim c --cpu:wasm32
test_int_muldiv.nim(151, 27): Check failed: truncate(a * b, int64) == -1000000000000'i64
truncate(a * b, int64) was -3567587328
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

No branches or pull requests

1 participant