Skip to content

Commit 7747c98

Browse files
committed
replace erroneous usage of s===0 with iszero(s)
`s===0` is equivalent to `isa(s,Int)&iszero(s)` which doesn't seem like the intended behavior. Also changed `||` to `|` because these comparisons don't seem to be costly enough to warrant the branch.
1 parent 7a82d20 commit 7747c98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/extras/random.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function randn(rng::AbstractRNG, ::Type{DoubleFloat{T}}) where {T<:IEEEFloat}
9090
urand2 = urand2 + urand2 - 1
9191
s = urand1*urand1 + urand2*urand2
9292

93-
(s >= 1 || s === 0) || break
93+
(s >= 1 | iszero(s)) || break
9494
end
9595

9696
s = sqrt( -log(s) / s )

0 commit comments

Comments
 (0)