diff --git a/jvector-base/src/main/java/io/github/jbellis/jvector/vector/DefaultVectorUtilSupport.java b/jvector-base/src/main/java/io/github/jbellis/jvector/vector/DefaultVectorUtilSupport.java index ed4166115..a5ec14bb9 100644 --- a/jvector-base/src/main/java/io/github/jbellis/jvector/vector/DefaultVectorUtilSupport.java +++ b/jvector-base/src/main/java/io/github/jbellis/jvector/vector/DefaultVectorUtilSupport.java @@ -135,7 +135,7 @@ public float cosine(VectorFloat av, VectorFloat bv) { norm1 += elem1 * elem1; norm2 += elem2 * elem2; } - return (float) (sum / Math.sqrt((double) norm1 * (double) norm2)); + return (float) (sum / Math.sqrt(norm1 * norm2)); } @Override @@ -152,7 +152,7 @@ public float cosine(VectorFloat av, int aoffset, VectorFloat bv, int boffs norm1 += elem1 * elem1; norm2 += elem2 * elem2; } - return (float) (sum / Math.sqrt((double) norm1 * (double) norm2)); + return (float) (sum / Math.sqrt(norm1 * norm2)); } @Override