if x = 0 then res := y; elif y = 0 then res := x; else res := sqrt(x^2+y^2); end if;