News for hackers. Stuff that matters.
Re:1/0 = 0 by simonbyrne on Friday August 10, 2018 @06:48PM (#17737248)
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...

Re:1/0 = 0 by spooneybarger on Friday August 10, 2018 @07:00PM (#17737309)
That might be an LLVM bug.

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

I'm going to have to look into that.

Thanks.

Re:1/0 = 0 by simonbyrne on Friday August 10, 2018 @07:16PM (#17737370)
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

Re:1/0 = 0 by spooneybarger on Friday August 10, 2018 @07:20PM (#17737387)
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