1 #include "ruby/missing.h"
6 /* This function doesn't set errno. It should on POSIX, though. */
9 nextafter(double x
, double y
)
23 /* the minimum "subnormal" float */
24 x1
= ldexp(0.5, DBL_MIN_EXP
- DBL_MANT_DIG
+ 1);
26 x1
= DBL_MIN
; /* the minimum "normal" float */
36 if (x
== -DBL_MAX
&& y
< 0 && isinf(y
))
42 if (x
== DBL_MAX
&& 0 < y
&& isinf(y
))
63 if (e
< DBL_MIN_EXP
) {
64 d
= ldexp(d
, DBL_MIN_EXP
-e
);