Skip to content

Commit

Permalink
Order of operations
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Sep 15, 2019
1 parent 0488cd2 commit ac4f6f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pynndescent/distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def fast_cosine(x, y):
elif norm_x == 0.0 or norm_y == 0.0:
return 1.0
else:
return 1.0 - (result * result / norm_x * norm_y)
return 1.0 - ((result * result) / (norm_x * norm_y))


@numba.vectorize(fastmath=True)
Expand Down

0 comments on commit ac4f6f9

Please sign in to comment.