mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-28 20:43:41 +01:00
Update to the latest s_scalbln.c from msun.
This commit is contained in:
parent
763da44606
commit
a2f4e102f2
1 changed files with 9 additions and 34 deletions
|
@ -24,55 +24,30 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cdefs-compat.h"
|
#include <sys/cdefs.h>
|
||||||
//__FBSDID("$FreeBSD: src/lib/msun/src/s_scalbln.c,v 1.2 2005/03/07 04:57:50 das Exp $");
|
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
#include <openlibm_math.h>
|
#include <openlibm_math.h>
|
||||||
|
|
||||||
#include "math_private.h"
|
#define NMAX 65536
|
||||||
|
#define NMIN -65536
|
||||||
|
|
||||||
DLLEXPORT double
|
DLLEXPORT double
|
||||||
scalbln (double x, long n)
|
scalbln(double x, long n)
|
||||||
{
|
{
|
||||||
int in;
|
|
||||||
|
|
||||||
in = (int)n;
|
return (scalbn(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
|
||||||
if (in != n) {
|
|
||||||
if (n > 0)
|
|
||||||
in = INT_MAX;
|
|
||||||
else
|
|
||||||
in = INT_MIN;
|
|
||||||
}
|
|
||||||
return (scalbn(x, in));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DLLEXPORT float
|
DLLEXPORT float
|
||||||
scalblnf (float x, long n)
|
scalblnf(float x, long n)
|
||||||
{
|
{
|
||||||
int in;
|
|
||||||
|
|
||||||
in = (int)n;
|
return (scalbnf(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
|
||||||
if (in != n) {
|
|
||||||
if (n > 0)
|
|
||||||
in = INT_MAX;
|
|
||||||
else
|
|
||||||
in = INT_MIN;
|
|
||||||
}
|
|
||||||
return (scalbnf(x, in));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DLLEXPORT long double
|
DLLEXPORT long double
|
||||||
scalblnl (long double x, long n)
|
scalblnl(long double x, long n)
|
||||||
{
|
{
|
||||||
int in;
|
|
||||||
|
|
||||||
in = (int)n;
|
return (scalbnl(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
|
||||||
if (in != n) {
|
|
||||||
if (n > 0)
|
|
||||||
in = INT_MAX;
|
|
||||||
else
|
|
||||||
in = INT_MIN;
|
|
||||||
}
|
|
||||||
return (scalbnl(x, (int)n));
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue