Added missing wrappers for hypot() and hypotf(), fixing bug #75.

I wouldn't be surprised, if more wrappers are still missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15709 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-12-29 02:01:55 +00:00
parent c83d9dad1c
commit 481b133143
4 changed files with 98 additions and 0 deletions
@@ -0,0 +1,48 @@
/* @(#)w_hypot.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: w_hypot.c,v 1.6 1995/05/10 20:49:07 jtc Exp $";
#endif
/*
* wrapper hypot(x,y)
*/
#include "math.h"
#include "math_private.h"
#ifdef __STDC__
double __hypot(double x, double y)/* wrapper hypot */
#else
double __hypot(x,y) /* wrapper hypot */
double x,y;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_hypot(x,y);
#else
double z;
z = __ieee754_hypot(x,y);
if(_LIB_VERSION == _IEEE_) return z;
if((!__finite(z))&&__finite(x)&&__finite(y))
return __kernel_standard(x,y,4); /* hypot overflow */
else
return z;
#endif
}
weak_alias (__hypot, hypot)
#ifdef NO_LONG_DOUBLE
strong_alias (__hypot, __hypotl)
weak_alias (__hypot, hypotl)
#endif
@@ -0,0 +1,48 @@
/* w_hypotf.c -- float version of w_hypot.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, [email protected].
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: w_hypotf.c,v 1.3 1995/05/10 20:49:09 jtc Exp $";
#endif
/*
* wrapper hypotf(x,y)
*/
#include "math.h"
#include "math_private.h"
#ifdef __STDC__
float __hypotf(float x, float y) /* wrapper hypotf */
#else
float __hypotf(x,y) /* wrapper hypotf */
float x,y;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_hypotf(x,y);
#else
float z;
z = __ieee754_hypotf(x,y);
if(_LIB_VERSION == _IEEE_) return z;
if((!__finitef(z))&&__finitef(x)&&__finitef(y))
/* hypot overflow */
return (float)__kernel_standard((double)x,(double)y,104);
else
return z;
#endif
}
weak_alias (__hypotf, hypotf)
@@ -93,6 +93,7 @@ local genericSources =
w_drem.c w_dremf.c # w_dreml.c
w_exp.c w_expf.c # w_expl.c
w_fmod.c w_fmodf.c # w_fmodl.c
w_hypot.c w_hypotf.c # w_hypotl.c
w_j0.c w_j0f.c
w_j1.c w_j1f.c
w_jn.c w_jnf.c
@@ -48,6 +48,7 @@ local genericSources =
w_drem.c w_dremf.c # w_dreml.c
w_exp.c w_expf.c # w_expl.c
w_fmod.c w_fmodf.c # w_fmodl.c
w_hypot.c w_hypotf.c # w_hypotl.c
w_j0.c w_j0f.c
w_j1.c w_j1f.c
w_jn.c w_jnf.c