mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-29 13:03:42 +01:00
Revert "Update to the latest s_scalbln.c from msun."
This reverts commit a2f4e102f2
.
This commit is contained in:
parent
a2f4e102f2
commit
8247b5af78
1 changed files with 34 additions and 9 deletions
|
@ -24,30 +24,55 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include "cdefs-compat.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>
|
||||||
|
|
||||||
#define NMAX 65536
|
#include "math_private.h"
|
||||||
#define NMIN -65536
|
|
||||||
|
|
||||||
DLLEXPORT double
|
DLLEXPORT double
|
||||||
scalbln(double x, long n)
|
scalbln (double x, long n)
|
||||||
{
|
{
|
||||||
|
int in;
|
||||||
|
|
||||||
return (scalbn(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
|
in = (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;
|
||||||
|
|
||||||
return (scalbnf(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
|
in = (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;
|
||||||
|
|
||||||
return (scalbnl(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n));
|
in = (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