Blame math/s_ldexp_template.c
|
Packit Service |
82fcde |
/* @(#)s_ldexp.c 5.1 93/09/24 */
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
* ====================================================
|
|
Packit Service |
82fcde |
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
Packit Service |
82fcde |
*
|
|
Packit Service |
82fcde |
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
Packit Service |
82fcde |
* Permission to use, copy, modify, and distribute this
|
|
Packit Service |
82fcde |
* software is freely granted, provided that this notice
|
|
Packit Service |
82fcde |
* is preserved.
|
|
Packit Service |
82fcde |
* ====================================================
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#if defined(LIBM_SCCS) && !defined(lint)
|
|
Packit Service |
82fcde |
static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <math.h>
|
|
Packit Service |
82fcde |
#include <math_private.h>
|
|
Packit Service |
82fcde |
#include <errno.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
FLOAT
|
|
Packit Service |
82fcde |
M_SUF (__ldexp) (FLOAT value, int exp)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
if(!isfinite(value)||value==0) return value + value;
|
|
Packit Service |
82fcde |
value = M_SCALBN(value,exp);
|
|
Packit Service |
82fcde |
if(!isfinite(value)||value==0) __set_errno (ERANGE);
|
|
Packit Service |
82fcde |
return value;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
declare_mgen_alias (__ldexp, ldexp)
|
|
Packit Service |
82fcde |
strong_alias (M_SUF (__ldexp), M_SUF (__wrap_scalbn))
|
|
Packit Service |
82fcde |
declare_mgen_alias (__wrap_scalbn, scalbn)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Note, versioning issues are punted to ldbl-opt in this case. */
|