zig/lib/libc/mingw/math/hypot.c
Andrew Kelley 49d1a4c562 move lib dirs to lib subdir
also start prefering NtDll API. so far:
 * NtQueryInformationFile
 * NtClose

adds a performance workaround for windows unicode conversion. but that
should probably be removed before merging
2019-07-15 17:54:50 -04:00

24 lines
533 B
C

/**
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#define _NEW_COMPLEX_DOUBLE 1
#include "../complex/complex_internal.h"
#include <errno.h>
#include <math.h>
double hypot (double x, double y)
{
int x_class = fpclassify (x);
int y_class = fpclassify (y);
if (x_class == FP_INFINITE || y_class == FP_INFINITE)
return __FLT_HUGE_VAL;
else if (x_class == FP_NAN || y_class == FP_NAN)
return __FLT_NAN;
return _hypot (x, y);
}