Skip to content

Commit

Permalink
Update runtime_intrinsics.c
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett authored Jan 22, 2025
1 parent 8395e67 commit fa5906b
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 @@ -1428,15 +1428,15 @@ float max_float(float x, float y) JL_NOTSAFEPOINT
float diff = x - y;
float argmax = signbit(diff) ? y : x;
int is_nan = isnan(x) || isnan(y);
return is_nan ? diff : argmin;
return is_nan ? diff : argmax;
}

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

#define _max(a, b) sizeof(a) == sizeof(float) ? max_float(a, b) : max_double(a, b)
Expand Down

0 comments on commit fa5906b

Please sign in to comment.