Skip to content

Commit 5378ffb

Browse files
committed
tests: ensure that call to sqrt passes double
1 parent a247c31 commit 5378ffb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/testthat/cpp/distance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ NumericMatrix rcpp_js_distance(NumericMatrix mat) {
6666
double d2 = kl_divergence(row2.begin(), row2.end(), avg.begin());
6767

6868
// write to output matrix
69-
rmat(i,j) = std::sqrt(.5 * (d1 + d2));
69+
rmat(i,j) = std::sqrt((double)(.5 * (d1 + d2)));
7070
}
7171
}
7272

0 commit comments

Comments
 (0)