Skip to content

Commit 36a582e

Browse files
musmsimonbyrne
authored andcommitted
Replace xor with or in frexp (#19479)
`xs` is always positive since we mask out the sign bit in line 415. `or` is more appropriate, although it doesn't matter here.
1 parent c80d523 commit 36a582e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/math.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ function frexp{T<:AbstractFloat}(x::T)
419419
xs == 0 && return x, 0 # +-0
420420
m = unsigned(leading_zeros(xs) - exponent_bits(T))
421421
xs <<= m
422-
xu = xs (xu & sign_mask(T))
422+
xu = xs | (xu & sign_mask(T))
423423
k = 1 - signed(m)
424424
end
425425
k -= (exponent_bias(T) - 1)

0 commit comments

Comments
 (0)