Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What about I64.min_value() / (-1)? Why does that give 0? If you're doing wrap-around arithmetic it should give I64.min_value().

https://tio.run/##K8jPq/z/PzG5JL9IwTcxM49LAQjyUssVkotSE0tSNV...



That might be an LLVM bug.

`I64.max_value() + 1` gives the expected result.

I'm going to have to look into that.

Thanks.


Apologies, I realise my comment was a bit snarky. Pony looks like a really neat language: I'll be interested to see what you do with it.

Unfortunately LLVM considers division overflow undefined: http://llvm.org/docs/LangRef.html#id109

If it's any use, you can see what Julia ended up doing here: https://github.com/JuliaLang/julia/issues/8188


I didn't take it as snarky. I was genuinely surprised. Thank you. If you intended it to be snarky, I didn't notice.

And thank you for the additional info, I've updated the issue I opened accordingly:

https://github.com/ponylang/ponyc/issues/2858




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: