diff --git a/src/runtime_intrinsics.c b/src/runtime_intrinsics.c index 4f1601ff4c850..e871514900eda 100644 --- a/src/runtime_intrinsics.c +++ b/src/runtime_intrinsics.c @@ -1428,7 +1428,7 @@ 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 @@ -1436,7 +1436,7 @@ 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)