From: Matthew Fernandez Date: Mon, 17 May 2021 02:30:00 +0000 (-0700) Subject: use more appropriate square root function in vlength X-Git-Tag: 2.47.3~24^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bdb0468978f5c5164847a87fc8a9719a4b14abc;p=graphviz use more appropriate square root function in vlength The square root functions sqrt and sqrtf compute on doubles and floats respectively. Using the float version here avoids a lossy conversion from double to float when returning from this function. --- diff --git a/cmd/smyrna/trackball.c b/cmd/smyrna/trackball.c index 9c0f61bf3..21d196d84 100644 --- a/cmd/smyrna/trackball.c +++ b/cmd/smyrna/trackball.c @@ -107,7 +107,7 @@ static void vcross(const float *v1, const float *v2, float *cross) static float vlength(const float *v) { - return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); } static void vscale(float *v, float div)