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)
}
}
}