Skip to content

Commit f4b4a58

Browse files
committed
Better version??
1 parent 4ea0848 commit f4b4a58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/device/intrinsics/math.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,14 @@ end
298298
if metal_version() >= sv"3.1" # macOS 14+
299299
ccall("extern air.nextafter.f32", llvmcall, Cfloat, (Cfloat, Cfloat), x, y)
300300
else
301-
error()
301+
reinterpret(Float32, reinterpret(UInt32, x) + sign(y-x))
302302
end
303303
end
304304
@device_function function nextafter(x::Float16, y::Float16)
305305
if metal_version() >= sv"3.1" # macOS 14+
306306
ccall("extern air.nextafter.f16", llvmcall, Float16, (Float16, Float16), x, y)
307307
else
308-
error()
308+
reinterpret(Float16, reinterpret(UInt16, x) + sign(y-x))
309309
end
310310
end
311311

0 commit comments

Comments
 (0)