mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
14 lines
201 B
V
14 lines
201 B
V
|
module test
|
||
|
|
||
|
import math
|
||
|
|
||
|
[export: 'square']
|
||
|
fn square(i int) int {
|
||
|
return i * i
|
||
|
}
|
||
|
|
||
|
[export: 'sqrt_of_sum_of_squares']
|
||
|
fn sqrt_of_sum_of_squares(x f64, y f64) f64 {
|
||
|
return math.sqrt(x * x + y * y)
|
||
|
}
|