2022-01-09 18:53:36 +01:00
|
|
|
module test
|
|
|
|
|
2022-02-16 08:12:49 +01:00
|
|
|
import math
|
|
|
|
|
2022-01-09 18:53:36 +01:00
|
|
|
[export: 'square']
|
|
|
|
fn square(i int) int {
|
|
|
|
return i * i
|
|
|
|
}
|
2022-02-16 08:12:49 +01:00
|
|
|
|
|
|
|
[export: 'sqrt_of_sum_of_squares']
|
|
|
|
fn sqrt_of_sum_of_squares(x f64, y f64) f64 {
|
|
|
|
return math.sqrt(x * x + y * y)
|
|
|
|
}
|