Skip to content

Commit

Permalink
runtime_intrinsics.c: Correct max_double
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett authored Jan 22, 2025
1 parent f91436e commit 8395e67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime_intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,15 +1426,15 @@ bi_fintrinsic(_min, min_float)
float max_float(float x, float y) JL_NOTSAFEPOINT
{
float diff = x - y;
float argmin = signbit(diff) ? y : x;
float argmax = signbit(diff) ? y : x;
int is_nan = isnan(x) || isnan(y);
return is_nan ? diff : argmin;
}

double max_double(double x, double y) JL_NOTSAFEPOINT
{
double diff = x - y;
double argmin = signbit(diff) ? x : y;
double argmax = signbit(diff) ? y : x;
int is_nan = isnan(x) || isnan(y);
return is_nan ? diff : argmin;
}
Expand Down

0 comments on commit 8395e67

Please sign in to comment.