master
1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5#define _NEW_COMPLEX_FLOAT 1
6
7#include "../complex/complex_internal.h"
8#include <errno.h>
9#include <math.h>
10
11float hypotf (float x, float y)
12{
13 int x_class = fpclassify (x);
14 int y_class = fpclassify (y);
15
16 if (x_class == FP_INFINITE || y_class == FP_INFINITE)
17 return __FLT_HUGE_VAL;
18 else if (x_class == FP_NAN || y_class == FP_NAN)
19 return __FLT_NAN;
20
21 return (float) _hypot (x, y);
22}
23