mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
.
This commit is contained in:
@ -26,7 +26,7 @@ static char rcsid[] = "$NetBSD: s_nextafter.c,v 1.8 1995/05/10 20:47:58 jtc Exp
|
||||
#define nexttoward __internal_nexttoward
|
||||
|
||||
#include <math.h>
|
||||
#include "math_private.h"
|
||||
#include <math_private.h>
|
||||
#include <float.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
@ -49,9 +49,12 @@ static char rcsid[] = "$NetBSD: s_nextafter.c,v 1.8 1995/05/10 20:47:58 jtc Exp
|
||||
return x+y;
|
||||
if(x==y) return y; /* x=y, return y */
|
||||
if((ix|lx)==0) { /* x == 0 */
|
||||
double u;
|
||||
INSERT_WORDS(x,hy&0x80000000,1); /* return +-minsubnormal */
|
||||
y = x*x;
|
||||
if(y==x) return y; else return x; /* raise underflow flag */
|
||||
u = math_opt_barrier (x);
|
||||
u = u*u;
|
||||
math_force_eval (u); /* raise underflow flag */
|
||||
return x;
|
||||
}
|
||||
if(hx>=0) { /* x > 0 */
|
||||
if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */
|
||||
@ -74,15 +77,12 @@ static char rcsid[] = "$NetBSD: s_nextafter.c,v 1.8 1995/05/10 20:47:58 jtc Exp
|
||||
if(hy>=0x7ff00000) {
|
||||
x = x+x; /* overflow */
|
||||
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
|
||||
asm ("" : "=m"(x) : "m"(x));
|
||||
asm ("" : "+m"(x));
|
||||
return x; /* overflow */
|
||||
}
|
||||
if(hy<0x00100000) { /* underflow */
|
||||
y = x*x;
|
||||
if(y!=x) { /* raise underflow flag */
|
||||
INSERT_WORDS(y,hx,lx);
|
||||
return y;
|
||||
}
|
||||
if(hy<0x00100000) {
|
||||
double u = x*x; /* underflow */
|
||||
math_force_eval (u); /* raise underflow flag */
|
||||
}
|
||||
INSERT_WORDS(x,hx,lx);
|
||||
return x;
|
||||
|
Reference in New Issue
Block a user