Skip to content

Commit

Permalink
Provide isinf and isnan for Float32 that works.
Browse files Browse the repository at this point in the history
This seems like not the best way to do this, but I'm
not sure what is and I need working 32-bit versions.
  • Loading branch information
StefanKarpinski committed Jan 29, 2011
1 parent ef912c3 commit 0420d5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion math_libm.j
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fpart(x) = x - trunc(x)
for f = {:isinf, :isnan}
@eval begin
($f)(x::Float64) = (0 != ccall(dlsym(libm,$string(f)), Int32, (Float64,), x))
($f)(x::Float32) = (0 != ccall(dlsym(libm,$strcat(string(f),"f")), Int32, (Float32,), x))
($f)(x::Float32) = ($f)(float64(x))
($f)(x::Int) = false
@vectorize $f
end
Expand Down

0 comments on commit 0420d5a

Please sign in to comment.