groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / src / libs / libgroff / hypot.cpp
CommitLineData
4d3e9548 1/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
465b256c
JR
2This file is part of the GNU C Library.
3
4The GNU C Library is free software; you can redistribute it and/or
5modify it under the terms of the GNU Library General Public License as
4d3e9548
JL
6published by the Free Software Foundation, either version 3 of the License, or
7(at your option) any later version.
465b256c
JR
8
9The GNU C Library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12Library General Public License for more details.
13
4d3e9548
JL
14You should have received a copy of the GNU Library General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. */
465b256c
JR
16
17#ifdef HAVE_CONFIG_H
18#include <config.h>
19#endif
20
21#include <math.h>
22
23#ifdef NEED_DECLARATION_HYPOT
24 double hypot(double, double);
25#endif /* NEED_DECLARATION_HYPOT */
26
27double groff_hypot(double x, double y)
28{
29 double result = hypot(x, y);
30
31#ifdef __INTERIX
32 /* hypot() on Interix is broken */
33 if (isnan(result) && !isnan(x) && !isnan(y))
34 return 0.0;
35#endif
36
37 return result;
38}