tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

26 lignes · 452 octetsBrut · Historique
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
5import std/io
6
7fn 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
19pub 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