Sign in
fuchsia
/
third_party
/
github.com
/
bazelbuild
/
rules_go
/
4e5aa2f448351d913325426f7ce0c850a099c9d3
/
.
/
tests
/
legacy
/
examples
/
cgo
/
cgo_lib_test.go
blob: a486da6ad4bd1720990ea7ecbe91c925a74987e7 [
file
] [
log
] [
blame
]
package cgo
import (
"math"
"testing"
)
func TestNsqrt(t *testing.T) {
for _, n := range []int{1, 2, 10, 100, 1000} {
got, want := Nsqrt(n), int(math.Floor(math.Sqrt(float64(n))))
if got != want {
t.Errorf("Nsqrt(n) = %d; want %d", got, want)
}
}
}