diff options
Diffstat (limited to 'tests/legacy/examples/cgo/generated.go.tpl')
-rw-r--r-- | tests/legacy/examples/cgo/generated.go.tpl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/legacy/examples/cgo/generated.go.tpl b/tests/legacy/examples/cgo/generated.go.tpl new file mode 100644 index 00000000..ba80e040 --- /dev/null +++ b/tests/legacy/examples/cgo/generated.go.tpl @@ -0,0 +1,13 @@ +package cgo + +import ( + //#cgo LDFLAGS: -lm + //#include <math.h> + "C" + "math" +) + +// Ncbrt returns the cube root of n. +func Ncbrt(n int) int { + return int(math.Floor(float64(C.cbrt(C.double(n))))) +} |