github.com/0xKiwi/rules_go@v0.24.3/tests/legacy/examples/cgo/sub/floor.go (about) 1 package sub 2 3 import ( 4 //#cgo LDFLAGS: -lm 5 //#include <math.h> 6 "C" 7 ) 8 9 // Floor calculates floor of the given number 10 // with the implementation in the standard C library. 11 func Floor(f float64) float64 { 12 return float64(C.floor(C.double(f))) 13 }