diff --git a/mlx/backend/cpu/simd/accelerate_simd.h b/mlx/backend/cpu/simd/accelerate_simd.h index 914831055..21c9d590d 100644 --- a/mlx/backend/cpu/simd/accelerate_simd.h +++ b/mlx/backend/cpu/simd/accelerate_simd.h @@ -253,12 +253,12 @@ Simd pow(Simd base, Simd exp) { } else { Simd res = 1; // Raising an integer to a negative power is undefined - if (any(exp < 0)) { + if (any(exp < static_cast(0))) { return 0; } - while (any(exp > 0)) { + while (any(exp > static_cast(0))) { res = select((exp & 1) != 0, res * base, res); - base = select(exp > 0, base * base, base); + base = select(exp > static_cast(0), base * base, base); exp = exp >> 1; } return res;