Skip to content

Commit 0949bda

Browse files
committed
Simplify nextafter() to nextup() / nextdown()
1 parent 207983c commit 0949bda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/random/randomizer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ PHP_METHOD(Random_Randomizer, nextFloat)
131131

132132
static double getFloat_gamma_low(double x)
133133
{
134-
return x - nextafter(x, -DBL_MAX);
134+
return x - nextdown(x);
135135
}
136136

137137
static double getFloat_gamma_high(double x)
138138
{
139-
return nextafter(x, DBL_MAX) - x;
139+
return nextup(x) - x;
140140
}
141141

142142
static double getFloat_gamma(double x, double y)

0 commit comments

Comments
 (0)