aboutsummaryrefslogtreecommitdiff
path: root/tests/legacy/examples/cgo/sub/floor.go
blob: 315b5c8fe42c3b0accaae147427bb3f1bd36f167 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package sub

import (
	//#cgo LDFLAGS: -lm
	//#include <math.h>
	"C"
)

// Floor calculates floor of the given number
// with the implementation in the standard C library.
func Floor(f float64) float64 {
	return float64(C.floor(C.double(f)))
}