mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
examples: enhance the call_v_from_python example, with a fn accepting 2 f64 params (#13480)
This commit is contained in:
parent
3ac4155f0c
commit
b8d656b308
2 changed files with 13 additions and 3 deletions
|
@ -1,6 +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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue