Skip to content

Commit c509ade

Browse files
committed
hardware indep. isinf for hardware floats
1 parent 1ea0de1 commit c509ade

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/float.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ isfinite(x::Float16) = reinterpret(UInt16,x)&0x7c00 != 0x7c00
503503
isfinite(x::Real) = decompose(x)[3] != 0
504504
isfinite(x::Integer) = true
505505

506-
isinf(x::Real) = !isnan(x) & !isfinite(x)
506+
isinf(x::Real) = (reinterpret(Unsigned, x) & ~sign_mask(T)) == exponent_mask(T)
507507

508508
## hashing small, built-in numeric types ##
509509

0 commit comments

Comments
 (0)