From: Matthew Fernandez Date: Sun, 2 May 2021 03:15:30 +0000 (-0700) Subject: use floating point math functions to squash a -Wfloat-conversion warning X-Git-Tag: 2.47.2~7^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40d34a600fc8fdba845a610e8007713b19b4cc56;p=graphviz use floating point math functions to squash a -Wfloat-conversion warning The function sqrt operates on doubles, which was triggering a -Wfloat-conversion compiler warning. The float version of this function is sqrtf, but we can further abbreviate this operation by observing it is computing the hypotenuse of a right-angled triangle and use the library function for that instead. --- diff --git a/lib/neatogen/sgd.c b/lib/neatogen/sgd.c index bd7ad6132..f66003942 100644 --- a/lib/neatogen/sgd.c +++ b/lib/neatogen/sgd.c @@ -13,7 +13,7 @@ static float calculate_stress(float *pos, term_sgd *terms, int n_terms) { for (ij=0; ij