From: Matthew Fernandez Date: Fri, 18 Jun 2021 00:31:55 +0000 (-0700) Subject: replace an open coded hypotenuse calculation in RAD with call to hypot X-Git-Tag: 2.48.0~43^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c05e3d316c44a505f384e94fe9679845e3d734b5;p=graphviz replace an open coded hypotenuse calculation in RAD with call to hypot The libc function hypot does the same work, with the potential to be more accurate and efficient. --- diff --git a/lib/fdpgen/xlayout.c b/lib/fdpgen/xlayout.c index 975e4870f..03560fc25 100644 --- a/lib/fdpgen/xlayout.c +++ b/lib/fdpgen/xlayout.c @@ -28,6 +28,7 @@ Increase less between tries #include #include #include +#include /* Use bbox based force function */ /* #define MS */ @@ -64,7 +65,7 @@ static double RAD(Agnode_t * n) { double w = WD2(n); double h = HT2(n); - return sqrt(w * w + h * h); + return hypot(w, h); } /* xinit_params: