Skip to content

Commit

Permalink
style: rename to
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 committed Sep 2, 2024
1 parent 5067bdb commit 587f0fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions maths/haversine_distance.nim
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ when isMainModule:
latitudeB: it[2], longitudeB: it[3],
expected: it[4])

func close(a, b: float): bool =
func isClose(a, b: float): bool =
return abs(a-b) < 0.0000001

for tc in testCases:
test tc.id:
checkpoint("returns expected result")
check close(haversineDistance(tc.latitudeA, tc.longitudeA, tc.latitudeB,
tc.longitudeB), tc.expected)
check close(haversineDistance(tc.latitudeB, tc.longitudeB, tc.latitudeA,
tc.longitudeA), tc.expected)
check isClose(haversineDistance(tc.latitudeA, tc.longitudeA,
tc.latitudeB, tc.longitudeB), tc.expected)
check isClose(haversineDistance(tc.latitudeB, tc.longitudeB,
tc.latitudeA, tc.longitudeA), tc.expected)

0 comments on commit 587f0fb

Please sign in to comment.