blob: ba80e04010e2963c23ce9dfc1e2ce23ffabad9f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)))))
}
|