
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1199 · main · 10 min 33 s
1Étoiles
0Forks
0Issues
| 1 | // Division by zero stops the actor, on both backends, also with a big |
| 2 | // dividend. (Overflow does not: Int promotes to a big integer, see |
| 3 | // bigint.lse.) |
| 4 | |
| 5 | import std/io |
| 6 | |
| 7 | fn grow :: n: Int times: Int -> Int |
| 8 | { |
| 9 | if times == 0 |
| 10 | { |
| 11 | n |
| 12 | } |
| 13 | else |
| 14 | { |
| 15 | grow (n * 2) (times - 1) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | pub fn main :: -> () / <io> |
| 20 | { |
| 21 | let big = grow 1 100 |
| 22 | io.println (show (big / 3 > 0)) |
| 23 | io.println (show (big / (big - big))) |
| 24 | } |
| 25 | //> True |
| 26 | //! panic: division by zero |