1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-26 13:49:14 +08:00

Use AlmostEqual for numerical comparison.

This commit is contained in:
Bert Chang 2014-05-05 23:28:49 +08:00
parent b4abf54c07
commit 1e21802d2e
2 changed files with 4 additions and 4 deletions

View File

@ -26,8 +26,8 @@ func TestPolyKernel(t *testing.T) {
Convey("When calculating distance", func() {
result := polyKernel.Distance(vectorX, vectorY)
Convey("The result should be 31.622776601683793", func() {
So(result, ShouldEqual, 31.622776601683793)
Convey("The result should alomost equal 31.622776601683793", func() {
So(result, ShouldAlmostEqual, 31.622776601683793)
})
})

View File

@ -18,8 +18,8 @@ func TestRBFKernel(t *testing.T) {
Convey("When doing inner product", func() {
result := rbfKernel.InnerProduct(vectorX, vectorY)
Convey("The result should be 0.4065696597405991", func() {
So(result, ShouldEqual, 0.4065696597405991)
Convey("The result should almost equal 0.4065696597405991", func() {
So(result, ShouldAlmostEqual, 0.4065696597405991)
})
})