1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: show how to call a simple v module from ruby (#19073) (#19073)

This is a copy/adaptation of the python example (#13105)
This commit is contained in:
Everton J. Carpes
2023-08-07 01:07:00 -03:00
committed by GitHub
parent 7c2f3e4530
commit 357ac0bb5a
4 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
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)
}