Stream: beginners

Topic: Overflow with `Num.powInt`


view this post on Zulip Kilian Vounckx (Sep 06 2024 at 13:22):

I am going through the exercism track and on the grains exercise I came acrosse this issue with Num.powInt.
It is easy to replicate in the repl, just type Num.powInt (Num.toU8 2) 8. I would expect this to overflow and panic, but instead it silently returns 0. Is this the wanted behavior? If not, is this issue known or should I create a new one on github?

view this post on Zulip Anton (Sep 06 2024 at 13:34):

Yeah, 0 is not correct :p
It doesn't look like a known issue, feel free to create a new one

view this post on Zulip Kilian Vounckx (Sep 06 2024 at 13:40):

Done


Last updated: Jul 06 2025 at 12:14 UTC