diff --git a/base/atomics.jl b/base/atomics.jl index 039cfe13ef619..1070dd81a0162 100644 --- a/base/atomics.jl +++ b/base/atomics.jl @@ -203,7 +203,7 @@ function atomic_and! end Atomically bitwise-nand (not-and) `x` with `val` -Performs `x[] = ~(x[] & val)` atomically. Returns the **old** value. +Performs `x[] = !(x[] & val)` atomically. Returns the **old** value. For further details, see LLVM's `atomicrmw nand` instruction. diff --git a/base/bitarray.jl b/base/bitarray.jl index f837977ea349c..bd190680d8f9e 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -81,7 +81,7 @@ IndexStyle(::Type{<:BitArray}) = IndexLinear() ## aux functions ## -const _msk64 = ~UInt64(0) +const _msk64 = !UInt64(0) @inline _div64(l) = l >> 6 @inline _mod64(l) = l & 63 @inline _msk_end(l::Integer) = _msk64 >>> _mod64(-l) @@ -94,7 +94,7 @@ function glue_src_bitchunks(src::Vector{UInt64}, k::Int, ks1::Int, msk_s0::UInt6 @inbounds begin chunk = ((src[k] & msk_s0) >>> ls0) if ks1 > k && ls0 > 0 - chunk_n = (src[k + 1] & ~msk_s0) + chunk_n = (src[k + 1] & !msk_s0) chunk |= (chunk_n << (64 - ls0)) end end @@ -117,20 +117,20 @@ function copy_chunks!(dest::Vector{UInt64}, pos_d::Integer, src::Vector{UInt64}, u = _msk64 if delta_kd == 0 - msk_d0 = ~(u << ld0) | (u << (ld1+1)) + msk_d0 = !(u << ld0) | (u << (ld1+1)) else - msk_d0 = ~(u << ld0) + msk_d0 = !(u << ld0) msk_d1 = (u << (ld1+1)) end if delta_ks == 0 - msk_s0 = (u << ls0) & ~(u << (ls1+1)) + msk_s0 = (u << ls0) & !(u << (ls1+1)) else msk_s0 = (u << ls0) end chunk_s0 = glue_src_bitchunks(src, ks0, ks1, msk_s0, ls0) - dest[kd0] = (dest[kd0] & msk_d0) | ((chunk_s0 << ld0) & ~msk_d0) + dest[kd0] = (dest[kd0] & msk_d0) | ((chunk_s0 << ld0) & !msk_d0) delta_kd == 0 && return @@ -152,7 +152,7 @@ function copy_chunks!(dest::Vector{UInt64}, pos_d::Integer, src::Vector{UInt64}, chunk_s = (chunk_s0 >>> (64 - ld0)) | (chunk_s1 << ld0) - dest[kd1] = (dest[kd1] & msk_d1) | (chunk_s & ~msk_d1) + dest[kd1] = (dest[kd1] & msk_d1) | (chunk_s & !msk_d1) return end @@ -177,24 +177,24 @@ function copy_chunks_rtol!(chunks::Vector{UInt64}, pos_d::Integer, pos_s::Intege delta_ks = ks1 - ks0 if delta_kd == 0 - msk_d0 = ~(u << ld0) | (u << (ld1+1)) + msk_d0 = !(u << ld0) | (u << (ld1+1)) else - msk_d0 = ~(u << ld0) + msk_d0 = !(u << ld0) msk_d1 = (u << (ld1+1)) end if delta_ks == 0 - msk_s0 = (u << ls0) & ~(u << (ls1+1)) + msk_s0 = (u << ls0) & !(u << (ls1+1)) else msk_s0 = (u << ls0) end - chunk_s0 = glue_src_bitchunks(chunks, ks0, ks1, msk_s0, ls0) & ~(u << s) - chunks[kd0] = (chunks[kd0] & msk_d0) | ((chunk_s0 << ld0) & ~msk_d0) + chunk_s0 = glue_src_bitchunks(chunks, ks0, ks1, msk_s0, ls0) & !(u << s) + chunks[kd0] = (chunks[kd0] & msk_d0) | ((chunk_s0 << ld0) & !msk_d0) if delta_kd != 0 chunk_s = (chunk_s0 >>> (64 - ld0)) - chunks[kd1] = (chunks[kd1] & msk_d1) | (chunk_s & ~msk_d1) + chunks[kd1] = (chunks[kd1] & msk_d1) | (chunk_s & !msk_d1) end left -= s @@ -212,10 +212,10 @@ function fill_chunks!(Bc::Array{UInt64}, x::Bool, pos::Integer, numbits::Integer u = _msk64 if k1 == k0 - msk0 = (u << l0) & ~(u << (l1+1)) + msk0 = (u << l0) & !(u << (l1+1)) else msk0 = (u << l0) - msk1 = ~(u << (l1+1)) + msk1 = !(u << (l1+1)) end @inbounds if x Bc[k0] |= msk0 @@ -224,11 +224,11 @@ function fill_chunks!(Bc::Array{UInt64}, x::Bool, pos::Integer, numbits::Integer end k1 > k0 && (Bc[k1] |= msk1) else - Bc[k0] &= ~msk0 + Bc[k0] &= !msk0 for k = k0+1:k1-1 Bc[k] = 0 end - k1 > k0 && (Bc[k1] &= ~msk1) + k1 > k0 && (Bc[k1] &= !msk1) end end @@ -253,10 +253,10 @@ function copy_to_bitarray_chunks!(Bc::Vector{UInt64}, pos_d::Int, C::Array{Bool} u = _msk64 if delta_kd == 0 - msk_d0 = msk_d1 = ~(u << ld0) | (u << (ld1+1)) + msk_d0 = msk_d1 = !(u << ld0) | (u << (ld1+1)) lt0 = ld1 else - msk_d0 = ~(u << ld0) + msk_d0 = !(u << ld0) msk_d1 = (u << (ld1+1)) lt0 = 63 end @@ -269,7 +269,7 @@ function copy_to_bitarray_chunks!(Bc::Vector{UInt64}, pos_d::Int, C::Array{Bool} c |= (UInt64(C[ind]) << j) ind += 1 end - Bc[kd0] = (Bc[kd0] & msk_d0) | (c & ~msk_d0) + Bc[kd0] = (Bc[kd0] & msk_d0) | (c & !msk_d0) bind += 1 end @@ -306,7 +306,7 @@ function copy_to_bitarray_chunks!(Bc::Vector{UInt64}, pos_d::Int, C::Array{Bool} c |= (UInt64(C[ind]) << j) ind += 1 end - Bc[kd1] = (Bc[kd1] & msk_d1) | (c & ~msk_d1) + Bc[kd1] = (Bc[kd1] & msk_d1) | (c & !msk_d1) end end @@ -408,7 +408,7 @@ function copyto!(dest::BitArray, src::BitArray) destc[nc] = srcc[nc] else msk_s = _msk_end(src) - msk_d = ~msk_s + msk_d = !msk_s destc[nc] = (msk_d & destc[nc]) | (msk_s & srcc[nc]) end end @@ -634,7 +634,7 @@ end u = UInt64(1) << i2 @inbounds begin c = Bc[i1] - Bc[i1] = ifelse(x, c | u, c & ~u) + Bc[i1] = ifelse(x, c | u, c & !u) end end @@ -676,7 +676,7 @@ function _unsafe_setindex!(B::BitArray, x, I::BitArray) end else for i = 1:length(Bc) - Bc[i] &= ~Ic[i] + Bc[i] &= !Ic[i] end end return B @@ -705,7 +705,7 @@ function _unsafe_setindex!(B::BitArray, X::AbstractArray, I::BitArray) if Imsk & u != 0 lx < c && throw_setindex_mismatch(X, c) @inbounds x = convert(Bool, X[c]) - C = ifelse(x, C | u, C & ~u) + C = ifelse(x, C | u, C & !u) c += 1 end u <<= 1 @@ -879,7 +879,7 @@ function insert!(B::BitVector, i::Integer, item) end msk_aft = (_msk64 << j) - msk_bef = ~msk_aft + msk_bef = !msk_aft Bc[k] = (msk_bef & Bc[k]) | ((msk_aft & Bc[k]) << 1) B[i] = item B @@ -889,7 +889,7 @@ function _deleteat!(B::BitVector, i::Integer) k, j = get_chunks_id(i) msk_bef = _msk64 >>> (63 - j) - msk_aft = ~msk_bef + msk_aft = !msk_bef msk_bef >>>= 1 Bc = B.chunks @@ -1088,13 +1088,13 @@ function (-)(B::BitArray) end broadcast(::typeof(sign), B::BitArray) = copy(B) -function broadcast(::typeof(~), B::BitArray) +function broadcast(::typeof(!), B::BitArray) C = similar(B) Bc = B.chunks if !isempty(Bc) Cc = C.chunks for i = 1:length(Bc) - Cc[i] = ~Bc[i] + Cc[i] = !Bc[i] end Cc[end] &= _msk_end(B) end @@ -1104,7 +1104,7 @@ end """ flipbits!(B::BitArray{N}) -> BitArray{N} -Performs a bitwise not operation on `B`. See [`~`](@ref). +Performs a bitwise not operation on `B`. See [`!`](@ref). # Examples ```jldoctest @@ -1123,7 +1123,7 @@ function flipbits!(B::BitArray) Bc = B.chunks @inbounds if !isempty(Bc) for i = 1:length(Bc) - Bc[i] = ~Bc[i] + Bc[i] = !Bc[i] end Bc[end] &= _msk_end(B) end @@ -1162,7 +1162,7 @@ broadcast(::typeof(&), B::BitArray, x::Bool) = x ? copy(B) : falses(size(B)) broadcast(::typeof(&), x::Bool, B::BitArray) = broadcast(&, B, x) broadcast(::typeof(|), B::BitArray, x::Bool) = x ? trues(size(B)) : copy(B) broadcast(::typeof(|), x::Bool, B::BitArray) = broadcast(|, B, x) -broadcast(::typeof(xor), B::BitArray, x::Bool) = x ? .~B : copy(B) +broadcast(::typeof(xor), B::BitArray, x::Bool) = x ? .!B : copy(B) broadcast(::typeof(xor), x::Bool, B::BitArray) = broadcast(xor, B, x) for f in (:&, :|, :xor) @eval begin @@ -1471,7 +1471,7 @@ end #findfirst(B::BitArray) = findnext(B, 1) ## defined in array.jl -# aux function: same as findnext(~B, start), but performed without temporaries +# aux function: same as findnext(!B, start), but performed without temporaries function findnextnot(B::BitArray, start::Integer) start > 0 || throw(BoundsError(B, start)) start > length(B) && return 0 @@ -1482,7 +1482,7 @@ function findnextnot(B::BitArray, start::Integer) chunk_start = _div64(start-1)+1 within_chunk_start = _mod64(start-1) - mask = ~(_msk64 << within_chunk_start) + mask = !(_msk64 << within_chunk_start) @inbounds if chunk_start < l if Bc[chunk_start] | mask != _msk64 @@ -1557,7 +1557,7 @@ function findprevnot(B::BitArray, start::Integer) Bc = B.chunks chunk_start = _div64(start-1)+1 - mask = ~_msk_end(start) + mask = !_msk_end(start) @inbounds begin if Bc[chunk_start] | mask != _msk64 @@ -1688,12 +1688,13 @@ maximum(B::BitArray) = isempty(B) ? throw(ArgumentError("argument must be non-em # arrays since there can be a 64x speedup by working at the level of Int64 # instead of looping bit-by-bit. -map(::Union{typeof(~), typeof(!)}, A::BitArray) = bit_map!(~, similar(A), A) +map(::typeof(!), A::BitArray) = bit_map!(!, similar(A), A) map(::typeof(zero), A::BitArray) = fill!(similar(A), false) map(::typeof(one), A::BitArray) = fill!(similar(A), true) map(::typeof(identity), A::BitArray) = copy(A) -map!(::Union{typeof(~), typeof(!)}, dest::BitArray, A::BitArray) = bit_map!(~, dest, A) +map!(::typeof(!), dest::BitArray, A::BitArray) = bit_map!(!, dest, A) + map!(::typeof(zero), dest::BitArray, A::BitArray) = fill!(dest, false) map!(::typeof(one), dest::BitArray, A::BitArray) = fill!(dest, true) map!(::typeof(identity), dest::BitArray, A::BitArray) = copyto!(dest, A) @@ -1701,11 +1702,11 @@ map!(::typeof(identity), dest::BitArray, A::BitArray) = copyto!(dest, A) for (T, f) in ((:(Union{typeof(&), typeof(*), typeof(min)}), :(&)), (:(Union{typeof(|), typeof(max)}), :(|)), (:(Union{typeof(xor), typeof(!=)}), :xor), - (:(Union{typeof(>=), typeof(^)}), :((p, q) -> p | ~q)), - (:(typeof(<=)), :((p, q) -> ~p | q)), - (:(typeof(==)), :((p, q) -> ~xor(p, q))), - (:(typeof(<)), :((p, q) -> ~p & q)), - (:(typeof(>)), :((p, q) -> p & ~q))) + (:(Union{typeof(>=), typeof(^)}), :((p, q) -> p | !q)), + (:(typeof(<=)), :((p, q) -> !p | q)), + (:(typeof(==)), :((p, q) -> !xor(p, q))), + (:(typeof(<)), :((p, q) -> !p & q)), + (:(typeof(>)), :((p, q) -> p & !q))) @eval map(::$T, A::BitArray, B::BitArray) = bit_map!($f, similar(A), A, B) @eval map!(::$T, dest::BitArray, A::BitArray, B::BitArray) = bit_map!($f, dest, A, B) end diff --git a/base/bitset.jl b/base/bitset.jl index 9304fc3051ab5..7eb3c84c6c36c 100644 --- a/base/bitset.jl +++ b/base/bitset.jl @@ -265,7 +265,7 @@ intersect(s1::BitSet, s2::BitSet) = intersect!(s1::BitSet, s2::BitSet) = _matched_map!(&, s1, s2) -setdiff!(s1::BitSet, s2::BitSet) = _matched_map!((p, q) -> p & ~q, s1, s2) +setdiff!(s1::BitSet, s2::BitSet) = _matched_map!((p, q) -> p & !q, s1, s2) symdiff!(s::BitSet, ns) = foldl(int_symdiff!, s, ns) diff --git a/base/bool.jl b/base/bool.jl index 135390cdf9859..8fa374692aad8 100644 --- a/base/bool.jl +++ b/base/bool.jl @@ -32,7 +32,6 @@ function !(x::Bool) return not_int(x) end -(~)(x::Bool) = !x (&)(x::Bool, y::Bool) = and_int(x, y) (|)(x::Bool, y::Bool) = or_int(x, y) diff --git a/base/checked.jl b/base/checked.jl index 61284a8620e54..d2836452a4a2e 100644 --- a/base/checked.jl +++ b/base/checked.jl @@ -148,8 +148,8 @@ end if BrokenUnsignedInt != Union{} function add_with_overflow(x::T, y::T) where T<:BrokenUnsignedInt # x + y > typemax(T) - # Note: ~y == -y-1 - x + y, x > ~y + # Note: !y == -y-1 + x + y, x > !y end end diff --git a/base/deprecated.jl b/base/deprecated.jl index 3b828b81ecaad..7267d59068ce2 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -2887,6 +2887,18 @@ workspace() = error("`workspace()` is discontinued, consider Revise.jl for an al @deprecate Ref(x::Ptr) Ref(x, 1) @deprecate Ref(x::Ref) x # or perhaps, `convert(Ref, x)` +# merge ~ into ! +@deprecate (~)(x::Bool) !x +@deprecate (~)(n::Integer) !n +@deprecate (~)(x::BitInteger) !x +@eval Base.GMP begin + import Base: ~ + @deprecate (~)(x::BigInt) !x +end +@deprecate map(::typeof(~), A::BitArray) map(!, A) +@deprecate map!(::typeof(~), dest::BitArray, A::BitArray) map(!, dest, A) +@deprecate broadcast(::typeof(~), B::BitArray) broadcast(!, B) + # PR #25184. Use getproperty instead of getindex for Factorizations function getindex(F::Factorization, s::Symbol) depwarn("`F[:$s]` is deprecated, use `F.$s` instead.", :getindex) diff --git a/base/exports.jl b/base/exports.jl index bbc505393a62e..6d810bcab67d2 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -214,7 +214,6 @@ export ^, |, |>, - ~, :, =>, ∘, diff --git a/base/float.jl b/base/float.jl index c0f5f6a3894ba..43d24a87164eb 100644 --- a/base/float.jl +++ b/base/float.jl @@ -82,7 +82,7 @@ function Float64(x::UInt128) else y = ((x >> (n-54)) % UInt64) & 0x001f_ffff_ffff_ffff # keep 1 extra bit y = (y+1)>>1 # round, ties up (extra leading bit in case of next exponent) - y &= ~UInt64(trailing_zeros(x) == (n-54)) # fix last bit to round to even + y &= !UInt64(trailing_zeros(x) == (n-54)) # fix last bit to round to even end d = ((n+1022) % UInt64) << 52 reinterpret(Float64, d + y) @@ -98,7 +98,7 @@ function Float64(x::Int128) else y = ((x >> (n-54)) % UInt64) & 0x001f_ffff_ffff_ffff # keep 1 extra bit y = (y+1)>>1 # round, ties up (extra leading bit in case of next exponent) - y &= ~UInt64(trailing_zeros(x) == (n-54)) # fix last bit to round to even + y &= !UInt64(trailing_zeros(x) == (n-54)) # fix last bit to round to even end d = ((n+1022) % UInt64) << 52 reinterpret(Float64, s | d + y) @@ -112,7 +112,7 @@ function Float32(x::UInt128) else y = ((x >> (n-25)) % UInt32) & 0x00ff_ffff # keep 1 extra bit y = (y+one(UInt32))>>1 # round, ties up (extra leading bit in case of next exponent) - y &= ~UInt32(trailing_zeros(x) == (n-25)) # fix last bit to round to even + y &= !UInt32(trailing_zeros(x) == (n-25)) # fix last bit to round to even end d = ((n+126) % UInt32) << 23 reinterpret(Float32, d + y) @@ -128,7 +128,7 @@ function Float32(x::Int128) else y = ((x >> (n-25)) % UInt32) & 0x00ff_ffff # keep 1 extra bit y = (y+one(UInt32))>>1 # round, ties up (extra leading bit in case of next exponent) - y &= ~UInt32(trailing_zeros(x) == (n-25)) # fix last bit to round to even + y &= !UInt32(trailing_zeros(x) == (n-25)) # fix last bit to round to even end d = ((n+126) % UInt32) << 23 reinterpret(Float32, s | d + y) @@ -177,7 +177,7 @@ function Float32(val::Float16) end sign = sign << 31 exp = (-14 - n_bit + 127) << 23 - sig = ((sig & (~bit)) << n_bit) << (23 - 10) + sig = ((sig & (!bit)) << n_bit) << (23 - 10) ret = sign | exp | sig end elseif exp == 0x1f @@ -856,7 +856,7 @@ uinttype(::Type{Float64}) = UInt64 uinttype(::Type{Float32}) = UInt32 uinttype(::Type{Float16}) = UInt16 -Base.iszero(x::Float16) = reinterpret(UInt16, x) & ~sign_mask(Float16) == 0x0000 +Base.iszero(x::Float16) = reinterpret(UInt16, x) & !sign_mask(Float16) == 0x0000 ## Array operations on floating point numbers ## diff --git a/base/gmp.jl b/base/gmp.jl index 37f47cc8932fa..3f00ff46016a6 100644 --- a/base/gmp.jl +++ b/base/gmp.jl @@ -4,7 +4,7 @@ module GMP export BigInt -import Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), xor, +import Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (!), (&), (|), xor, binomial, cmp, convert, div, divrem, factorial, fld, gcd, gcdx, lcm, mod, ndigits, promote_rule, rem, show, isqrt, string, powermod, sum, trailing_zeros, trailing_ones, count_ones, base, tryparse_internal, @@ -289,7 +289,7 @@ function BigInt(x::Integer) b = BigInt(0) shift = 0 while x < -1 - b += BigInt(~UInt32(x&0xffffffff))<>= 32 shift += 32 end @@ -466,7 +466,7 @@ end # unary ops (-)(x::BigInt) = MPZ.neg(x) -(~)(x::BigInt) = MPZ.com(x) +(!)(x::BigInt) = MPZ.com(x) <<(x::BigInt, c::UInt) = c == 0 ? x : MPZ.mul_2exp(x, c) >>(x::BigInt, c::UInt) = c == 0 ? x : MPZ.fdiv_q_2exp(x, c) diff --git a/base/grisu/bignums.jl b/base/grisu/bignums.jl index 54a948da473e7..d1e6caf342b1e 100644 --- a/base/grisu/bignums.jl +++ b/base/grisu/bignums.jl @@ -397,7 +397,7 @@ function assignpoweruint16!(x::Bignum,base::UInt16,power_exponent::Int) while mask != 0 && this_value <= max_32bits this_value *= this_value if (power_exponent & mask) != 0 - base_bits_mask::UInt64 = ~(UInt64(1) << (64 - bit_size) - 1) + base_bits_mask::UInt64 = !(UInt64(1) << (64 - bit_size) - 1) high_bits_zero = (this_value & base_bits_mask) == 0 if high_bits_zero this_value *= base diff --git a/base/hashing.jl b/base/hashing.jl index caa1be81036aa..d027ce9fe2c11 100644 --- a/base/hashing.jl +++ b/base/hashing.jl @@ -26,7 +26,7 @@ hash(@nospecialize(x), h::UInt) = hash_uint(3h - object_id(x)) function hash_64_64(n::UInt64) local a::UInt64 = n - a = ~a + a << 21 + a = !a + a << 21 a = a ⊻ a >> 24 a = a + a << 3 + a << 8 a = a ⊻ a >> 14 @@ -38,7 +38,7 @@ end function hash_64_32(n::UInt64) local a::UInt64 = n - a = ~a + a << 18 + a = !a + a << 18 a = a ⊻ a >> 31 a = a * 21 a = a ⊻ a >> 11 diff --git a/base/inference.jl b/base/inference.jl index ab3b0bcff5424..7bc28fc862542 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -5866,7 +5866,7 @@ function split_undef_flag_pass!(sv::OptimizationState) end for i in 1:norigslots if flagslots[i] != 0 - sv.src.slotflags[i] = (sv.src.slotflags[i] | Slot_StaticUndef) & ~UInt8(Slot_UsedUndef) + sv.src.slotflags[i] = (sv.src.slotflags[i] | Slot_StaticUndef) & !UInt8(Slot_UsedUndef) end end end diff --git a/base/int.jl b/base/int.jl index fbe352b343ad9..5a0ef1f5c9aa3 100644 --- a/base/int.jl +++ b/base/int.jl @@ -132,7 +132,7 @@ function abs end abs(x::Unsigned) = x abs(x::Signed) = flipsign(x,x) -~(n::Integer) = -n-1 +!(n::Integer) = -n-1 unsigned(x::BitSigned) = reinterpret(typeof(convert(Unsigned, zero(x))), x) unsigned(x::Bool) = convert(Unsigned, x) @@ -252,23 +252,23 @@ end ## integer bitwise operations ## """ - ~(x) + !(x) Bitwise not. # Examples ```jldoctest -julia> ~4 +julia> !4 -5 -julia> ~10 +julia> !10 -11 -julia> ~true +julia> !true false ``` """ -(~)(x::BitInteger) = not_int(x) +(!)(x::BitInteger) = not_int(x) """ &(x, y) @@ -373,7 +373,7 @@ julia> count_zeros(Int32(2 ^ 16 - 1)) 16 ``` """ -count_zeros(x::Integer) = count_ones(~x) +count_zeros(x::Integer) = count_ones(!x) """ leading_ones(x::Integer) -> Integer @@ -385,7 +385,7 @@ julia> leading_ones(UInt32(2 ^ 32 - 2)) 31 ``` """ -leading_ones(x::Integer) = leading_zeros(~x) +leading_ones(x::Integer) = leading_zeros(!x) """ trailing_ones(x::Integer) -> Integer @@ -397,7 +397,7 @@ julia> trailing_ones(3) 2 ``` """ -trailing_ones(x::Integer) = trailing_zeros(~x) +trailing_ones(x::Integer) = trailing_zeros(!x) ## integer comparisons ## diff --git a/base/libgit2/consts.jl b/base/libgit2/consts.jl index 07f6f75c6df44..cf607ad453bed 100644 --- a/base/libgit2/consts.jl +++ b/base/libgit2/consts.jl @@ -139,7 +139,7 @@ const IDXENTRY_NEW_SKIP_WORKTREE = Cint(1 << 9) const INDEXCAP_IGNORE_CASE = Cuint(1) const INDEXCAP_NO_FILEMODE = Cuint(2) const INDEXCAP_NO_SYMLINKS = Cuint(4) -const INDEXCAP_FROM_OWNER = ~Cuint(0) +const INDEXCAP_FROM_OWNER = !Cuint(0) const INDEX_ADD_DEFAULT = Cuint(0) const INDEX_ADD_FORCE = Cuint(1 << 0) diff --git a/base/libgit2/utils.jl b/base/libgit2/utils.jl index f692005ef8de5..12b72ff58db64 100644 --- a/base/libgit2/utils.jl +++ b/base/libgit2/utils.jl @@ -51,7 +51,7 @@ isset(val::Integer, flag::Integer) = (val & flag == flag) Unset the bits of `val` indexed by `flag`, returning them to `0`. """ -reset(val::Integer, flag::Integer) = (val &= ~flag) +reset(val::Integer, flag::Integer) = (val &= !flag) """ toggle(val::Integer, flag::Integer) diff --git a/base/linalg/bitarray.jl b/base/linalg/bitarray.jl index ea127ddfeebf4..a3bc198f3a257 100644 --- a/base/linalg/bitarray.jl +++ b/base/linalg/bitarray.jl @@ -133,12 +133,12 @@ function nonzero_chunks(chunks::Vector{UInt64}, pos0::Int, pos1::Int) delta_k = k1 - k0 z = UInt64(0) - u = ~z + u = !z if delta_k == 0 - msk_0 = (u << l0) & ~(u << l1 << 1) + msk_0 = (u << l0) & !(u << l1 << 1) else msk_0 = (u << l0) - msk_1 = ~(u << l1 << 1) + msk_1 = !(u << l1 << 1) end @inbounds begin diff --git a/base/math.jl b/base/math.jl index dc0d1b276300c..0b268fcc79666 100644 --- a/base/math.jl +++ b/base/math.jl @@ -542,7 +542,7 @@ julia> ldexp(5., 2) """ function ldexp(x::T, e::Integer) where T<:IEEEFloat xu = reinterpret(Unsigned, x) - xs = xu & ~sign_mask(T) + xs = xu & !sign_mask(T) xs >= exponent_mask(T) && return x # NaN or Inf k = Int(xs >> significand_bits(T)) if k == 0 # x is subnormal @@ -568,7 +568,7 @@ function ldexp(x::T, e::Integer) where T<:IEEEFloat return flipsign(T(Inf), x) end if k > 0 # normal case - xu = (xu & ~exponent_mask(T)) | (rem(k, uinttype(T)) << significand_bits(T)) + xu = (xu & !exponent_mask(T)) | (rem(k, uinttype(T)) << significand_bits(T)) return reinterpret(T, xu) else # subnormal case if k <= -significand_bits(T) # underflow @@ -578,7 +578,7 @@ function ldexp(x::T, e::Integer) where T<:IEEEFloat end k += significand_bits(T) z = T(2.0)^-significand_bits(T) - xu = (xu & ~exponent_mask(T)) | (rem(k, uinttype(T)) << significand_bits(T)) + xu = (xu & !exponent_mask(T)) | (rem(k, uinttype(T)) << significand_bits(T)) return z*reinterpret(T, xu) end end @@ -592,7 +592,7 @@ Get the exponent of a normalized floating-point number. function exponent(x::T) where T<:IEEEFloat @noinline throw1(x) = throw(DomainError(x, "Cannot be NaN or Inf.")) @noinline throw2(x) = throw(DomainError(x, "Cannot be subnormal converted to 0.")) - xs = reinterpret(Unsigned, x) & ~sign_mask(T) + xs = reinterpret(Unsigned, x) & !sign_mask(T) xs >= exponent_mask(T) && throw1(x) k = Int(xs >> significand_bits(T)) if k == 0 # x is subnormal @@ -621,15 +621,15 @@ julia> significand(15.2)*8 """ function significand(x::T) where T<:IEEEFloat xu = reinterpret(Unsigned, x) - xs = xu & ~sign_mask(T) + xs = xu & !sign_mask(T) xs >= exponent_mask(T) && return x # NaN or Inf - if xs <= (~exponent_mask(T) & ~sign_mask(T)) # x is subnormal + if xs <= (!exponent_mask(T) & !sign_mask(T)) # x is subnormal xs == 0 && return x # +-0 m = unsigned(leading_zeros(xs) - exponent_bits(T)) xs <<= m xu = xs | (xu & sign_mask(T)) end - xu = (xu & ~exponent_mask(T)) | exponent_one(T) + xu = (xu & !exponent_mask(T)) | exponent_one(T) return reinterpret(T, xu) end @@ -641,7 +641,7 @@ and `val` is equal to ``x \\times 2^{exp}``. """ function frexp(x::T) where T<:IEEEFloat xu = reinterpret(Unsigned, x) - xs = xu & ~sign_mask(T) + xs = xu & !sign_mask(T) xs >= exponent_mask(T) && return x, 0 # NaN or Inf k = Int(xs >> significand_bits(T)) if k == 0 # x is subnormal @@ -652,7 +652,7 @@ function frexp(x::T) where T<:IEEEFloat k = 1 - m end k -= (exponent_bias(T) - 1) - xu = (xu & ~exponent_mask(T)) | exponent_half(T) + xu = (xu & !exponent_mask(T)) | exponent_half(T) return reinterpret(T, xu), k end diff --git a/base/multidimensional.jl b/base/multidimensional.jl index b2178a3e83c41..d6a57acb6d5c5 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -1460,10 +1460,10 @@ function copy_to_bitarray_chunks!(Bc::Vector{UInt64}, pos_d::Int, C::StridedArra u = _msk64 if delta_kd == 0 - msk_d0 = msk_d1 = ~(u << ld0) | (u << (ld1+1)) + msk_d0 = msk_d1 = !(u << ld0) | (u << (ld1+1)) lt0 = ld1 else - msk_d0 = ~(u << ld0) + msk_d0 = !(u << ld0) msk_d1 = (u << (ld1+1)) lt0 = 63 end @@ -1476,7 +1476,7 @@ function copy_to_bitarray_chunks!(Bc::Vector{UInt64}, pos_d::Int, C::StridedArra c |= (UInt64(unchecked_bool_convert(C[ind])) << j) ind += 1 end - Bc[kd0] = (Bc[kd0] & msk_d0) | (c & ~msk_d0) + Bc[kd0] = (Bc[kd0] & msk_d0) | (c & !msk_d0) bind += 1 end @@ -1498,7 +1498,7 @@ function copy_to_bitarray_chunks!(Bc::Vector{UInt64}, pos_d::Int, C::StridedArra c |= (UInt64(unchecked_bool_convert(C[ind])) << j) ind += 1 end - Bc[kd1] = (Bc[kd1] & msk_d1) | (c & ~msk_d1) + Bc[kd1] = (Bc[kd1] & msk_d1) | (c & !msk_d1) end end diff --git a/base/pcre.jl b/base/pcre.jl index d144e9a6a5b1c..53e602e150a58 100644 --- a/base/pcre.jl +++ b/base/pcre.jl @@ -67,7 +67,7 @@ const EXECUTE_MASK = const OPTIONS_MASK = COMPILE_MASK | EXECUTE_MASK -const UNSET = ~Csize_t(0) # Indicates that an output vector element is unset +const UNSET = !Csize_t(0) # Indicates that an output vector element is unset function info(regex::Ptr{Cvoid}, what::Integer, ::Type{T}) where T buf = Ref{T}() diff --git a/base/pkg/resolve/maxsum.jl b/base/pkg/resolve/maxsum.jl index c35bdc5aa9b58..6207147c2f6f3 100644 --- a/base/pkg/resolve/maxsum.jl +++ b/base/pkg/resolve/maxsum.jl @@ -450,7 +450,7 @@ function decimate(n::Int, graph::Graph, msgs::Messages) end if !did_dec # still didn't succeed, give up - p0 = first(fldorder[.~(decimated)]) + p0 = first(fldorder[.!(decimated)]) throw(UnsatError(p0)) end diff --git a/base/random/generation.jl b/base/random/generation.jl index 0d36a6a7c9f5b..d3e7092379304 100644 --- a/base/random/generation.jl +++ b/base/random/generation.jl @@ -312,7 +312,7 @@ function Sampler(::AbstractRNG, r::AbstractUnitRange{BigInt}, ::Repetition) nd = ndigits(m, 2) nlimbs, highbits = divrem(nd, 8*sizeof(Limb)) highbits > 0 && (nlimbs += 1) - mask = highbits == 0 ? ~zero(Limb) : one(Limb)< exp(1.0) ``` """ function exp(x::T) where T<:Union{Float32,Float64} - xa = reinterpret(Unsigned, x) & ~sign_mask(T) + xa = reinterpret(Unsigned, x) & !sign_mask(T) xsb = signbit(x) # filter out non-finite arguments diff --git a/base/special/exp10.jl b/base/special/exp10.jl index 711da3b04549b..dede5aa241d60 100644 --- a/base/special/exp10.jl +++ b/base/special/exp10.jl @@ -82,7 +82,7 @@ julia> exp10(0.2) ``` """ function exp10(x::T) where T<:Union{Float32,Float64} - xa = reinterpret(Unsigned, x) & ~sign_mask(T) + xa = reinterpret(Unsigned, x) & !sign_mask(T) xsb = signbit(x) # filter out non-finite arguments diff --git a/base/version.jl b/base/version.jl index 7dc2fe27c3818..0e3657c33121e 100644 --- a/base/version.jl +++ b/base/version.jl @@ -168,8 +168,8 @@ function hash(v::VersionNumber, h::UInt) h = hash(v.major, h) h = hash(v.minor, h) h = hash(v.patch, h) - h = hash(v.prerelease, ~h) - h = hash(v.build, ~h) + h = hash(v.prerelease, !h) + h = hash(v.build, !h) end lowerbound(v::VersionNumber) = VersionNumber(v.major, v.minor, v.patch, ("",), ()) diff --git a/doc/src/base/math.md b/doc/src/base/math.md index 6b8cbf0bdaa7f..8a449e1fc9477 100644 --- a/doc/src/base/math.md +++ b/doc/src/base/math.md @@ -44,7 +44,6 @@ Base.:(<=) Base.:(>) Base.:(>=) Base.cmp -Base.:(~) Base.:(&) Base.:(|) Base.xor diff --git a/doc/src/base/punctuation.md b/doc/src/base/punctuation.md index 13fab22b8d277..92fd8d9d30f8e 100644 --- a/doc/src/base/punctuation.md +++ b/doc/src/base/punctuation.md @@ -20,7 +20,7 @@ Extended documentation for mathematical symbols & functions is [here](@ref math- | `⊻` | bitwise xor operator | | `*` | multiply, or matrix multiply | | `()` | the empty tuple | -| `~` | bitwise not operator | +| `!` | bitwise not operator | | `\` | backslash operator | | `'` | complex transpose operator Aᴴ | | `a[]` | array indexing (calling [`getindex`](@ref) or [`setindex!`](@ref)) | diff --git a/doc/src/manual/mathematical-operations.md b/doc/src/manual/mathematical-operations.md index b539efbe3d0e5..f06a80f83c201 100644 --- a/doc/src/manual/mathematical-operations.md +++ b/doc/src/manual/mathematical-operations.md @@ -55,7 +55,7 @@ are supported on all primitive integer types: | Expression | Name | |:---------- |:------------------------------------------------------------------------ | -| `~x` | bitwise not | +| `!x` | bitwise not | | `x & y` | bitwise and | | `x \| y` | bitwise or | | `x ⊻ y` | bitwise xor (exclusive or) | @@ -66,7 +66,7 @@ are supported on all primitive integer types: Here are some examples with bitwise operators: ```jldoctest -julia> ~123 +julia> !123 -124 julia> 123 & 234 @@ -81,10 +81,10 @@ julia> 123 ⊻ 234 julia> xor(123, 234) 145 -julia> ~UInt32(123) +julia> !UInt32(123) 0xffffff84 -julia> ~UInt8(123) +julia> !UInt8(123) 0x84 ``` diff --git a/doc/src/manual/noteworthy-differences.md b/doc/src/manual/noteworthy-differences.md index 5874e57dbde86..e601d94a558b1 100644 --- a/doc/src/manual/noteworthy-differences.md +++ b/doc/src/manual/noteworthy-differences.md @@ -247,7 +247,7 @@ For users coming to Julia from R, these are some noteworthy differences: leading 0s. For example, `0x0` and `0x00` have type [`UInt8`](@ref), `0x000` and `0x0000` have type [`UInt16`](@ref), then literals with 5 to 8 hex digits have type `UInt32`, 9 to 16 hex digits type `UInt64` and 17 to 32 hex digits type `UInt128`. This needs to be taken into account when defining - hexadecimal masks, for example `~0xf == 0xf0` is very different from `~0x000f == 0xfff0`. 64 bit `Float64` + hexadecimal masks, for example `!0xf == 0xf0` is very different from `!0x000f == 0xfff0`. 64 bit `Float64` and 32 bit [`Float32`](@ref) bit literals are expressed as `1.0` and `1.0f0` respectively. Floating point literals are rounded (and not promoted to the `BigFloat` type) if they can not be exactly represented. Floating point literals are closer in behavior to C/C++. Octal (prefixed with `0o`) and binary diff --git a/stdlib/FileWatching/src/FileWatching.jl b/stdlib/FileWatching/src/FileWatching.jl index 81bef41dd5d4b..eba6f1dce8d32 100644 --- a/stdlib/FileWatching/src/FileWatching.jl +++ b/stdlib/FileWatching/src/FileWatching.jl @@ -380,11 +380,11 @@ function wait(fdw::_FDWatcher; readable=true, writable=true) events |= FDEvent(fdw.events) haveevent = false if readable && isreadable(events) - fdw.events &= ~UV_READABLE + fdw.events &= !UV_READABLE haveevent = true end if writable && iswritable(events) - fdw.events &= ~UV_WRITABLE + fdw.events &= !UV_WRITABLE haveevent = true end if haveevent diff --git a/test/arrayops.jl b/test/arrayops.jl index 79a91b9a46405..d944a6fcb5680 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -1992,7 +1992,7 @@ end @test f15894(fill(1, 100)) == 100 end -@testset "sign, conj, ~" begin +@testset "sign, conj, !" begin local A, B, C A = [-10,0,3] B = [-10.0,0.0,3.0] @@ -2010,8 +2010,8 @@ end @test typeof(conj(B)) == Vector{Float64} @test typeof(conj(C)) == Vector{Complex{Int}} - @test .~A == [9,-1,-4] - @test typeof(.~A) == Vector{Int} + @test .!A == [9,-1,-4] + @test typeof(.!A) == Vector{Int} end # @inbounds is expression-like, returning its value; #15558 diff --git a/test/bigint.jl b/test/bigint.jl index dddcc66c467fd..169e2bcc18400 100644 --- a/test/bigint.jl +++ b/test/bigint.jl @@ -181,7 +181,7 @@ end @test BigInt(-5) << -1 == -3 end @testset "boolean ops" begin - @test ~BigInt(123) == -124 + @test !BigInt(123) == -124 @test BigInt(123) & BigInt(234) == 106 @test BigInt(123) | BigInt(234) == 251 @test BigInt(123) ⊻ BigInt(234) == 145 diff --git a/test/bitarray.jl b/test/bitarray.jl index 38b6b38794a16..63bb2e08ddf74 100644 --- a/test/bitarray.jl +++ b/test/bitarray.jl @@ -742,7 +742,6 @@ timesofar("dequeue") @testset "Unary operators" begin b1 = bitrand(n1, n2) - @check_bit_operation broadcast(~, b1) BitMatrix @check_bit_operation broadcast(!, b1) BitMatrix @check_bit_operation (-)(b1) Matrix{Int} @check_bit_operation broadcast(sign, b1) BitMatrix @@ -751,7 +750,6 @@ timesofar("dequeue") @check_bit_operation conj(b1) BitMatrix b0 = falses(0) - @check_bit_operation broadcast(~, b0) BitVector @check_bit_operation broadcast(!, b0) BitVector @check_bit_operation (-)(b0) Vector{Int} @check_bit_operation broadcast(sign, b0) BitVector @@ -759,7 +757,7 @@ timesofar("dequeue") @testset "flipbits!" begin b1 = bitrand(n1, n2) i1 = Array(b1) - @test flipbits!(b1) == .~i1 + @test flipbits!(b1) == .!i1 @test bitcheck(b1) end end @@ -1095,13 +1093,13 @@ timesofar("datamove") b1 = trues(v1) for i = 0:(v1-1) @test findfirst(b1 >> i) == i+1 - @test Base.findfirstnot(.~(b1 >> i)) == i+1 + @test Base.findfirstnot(.!(b1 >> i)) == i+1 end for i = 3:(v1-1), j = 2:i submask = b1 << (v1-j+1) @test findnext((b1 >> i) .| submask, j) == i+1 - @test findnextnot((.~(b1 >> i)) .⊻ submask, j) == i+1 + @test findnextnot((.!(b1 >> i)) .⊻ submask, j) == i+1 end b1 = bitrand(n1, n2) @@ -1140,7 +1138,7 @@ timesofar("nnz&find") for c = [falses, trues] b1 = c(n) b1[elts] = .!b1[elts] - b2 = .~b1 + b2 = .!b1 i1 = Array(b1) for i = 1:n @test findprev(b1, i) == findprev(i1, i) == findprevnot(b2, i) == findprev(!, b2, i) @@ -1151,7 +1149,7 @@ timesofar("nnz&find") b1 = falses(1000) b1[77] = true b1[777] = true - b2 = .~b1 + b2 = .!b1 @test_throws BoundsError findprev(b1, 1001) @test_throws BoundsError findprevnot(b2, 1001) @test_throws BoundsError findprev(!, b2, 1001) @@ -1207,13 +1205,13 @@ timesofar("nnz&find") @test findprev(t, l) == findprevnot(f, l) == l b1 = falses(l) b1[end] = true - b2 = .~b1 + b2 = .!b1 @test findprev(b1, l) == findprevnot(b2, l) == l @test findprevnot(b1, l) == findprev(b2, l) == l-1 if l > 1 b1 = falses(l) b1[end-1] = true - b2 = .~b1 + b2 = .!b1 @test findprev(b1, l) == findprevnot(b2, l) == l-1 @test findprevnot(b1, l) == findprev(b2, l) == l end @@ -1246,7 +1244,7 @@ timesofar("reductions") for l = [0, 1, 63, 64, 65, 127, 128, 129, 255, 256, 257, 6399, 6400, 6401] b1 = bitrand(l) b2 = bitrand(l) - @test map(~, b1) == map(x->~x, b1) == broadcast(~, b1) + @test map(!, b1) == map(x->!x, b1) == broadcast(!, b1) @test map(identity, b1) == map(x->x, b1) == b1 @test map(&, b1, b2) == map((x,y)->x&y, b1, b2) == broadcast(&, b1, b2) @@ -1268,8 +1266,7 @@ timesofar("reductions") @testset "map! for length $l" begin b = BitVector(uninitialized, l) - @test map!(~, b, b1) == map!(x->~x, b, b1) == broadcast(~, b1) == b - @test map!(!, b, b1) == map!(x->!x, b, b1) == broadcast(~, b1) == b + @test map!(!, b, b1) == map!(x->!x, b, b1) == broadcast(!, b1) == b @test map!(identity, b, b1) == map!(x->x, b, b1) == b1 == b @test map!(zero, b, b1) == map!(x->false, b, b1) == falses(l) == b @test map!(one, b, b1) == map!(x->true, b, b1) == trues(l) == b @@ -1298,7 +1295,7 @@ timesofar("reductions") B17970 = map(x -> x ? 1 : 2, A17970) @test B17970::Array{Int,1} == [2,1,2] C17970 = map(x -> x ? false : true, A17970) - @test C17970::BitArray{1} == map(~, A17970) + @test C17970::BitArray{1} == map(!, A17970) end end diff --git a/test/core.jl b/test/core.jl index 7b470ec4113a0..a07ba84cd1d62 100644 --- a/test/core.jl +++ b/test/core.jl @@ -567,7 +567,7 @@ let end # tricky space sensitive syntax cases -@test [-1 ~1] == [(-1) (~1)] +@test [-1 !1] == [(-1) (!1)] # undefinedness mutable struct UndefField diff --git a/test/int.jl b/test/int.jl index ba4c998bdc4bb..a15d86f9f8dc8 100644 --- a/test/int.jl +++ b/test/int.jl @@ -102,7 +102,7 @@ end @test mod(123, UInt8) == 0x7b primitive type MyBitsType <: Integer 8 end -@test_throws MethodError ~reinterpret(MyBitsType, 0x7b) +@test_throws MethodError !reinterpret(MyBitsType, 0x7b) UItypes = Base.BitUnsigned_types SItypes = Base.BitSigned_types diff --git a/test/numbers.jl b/test/numbers.jl index dd9adc60ebae4..158dd1067eae4 100644 --- a/test/numbers.jl +++ b/test/numbers.jl @@ -19,8 +19,8 @@ const ≣ = isequal # convenient for comparing NaNs @test true != false @test false != true - @test ~true == false - @test ~false == true + @test !true == false + @test !false == true @test false & false == false @test true & false == false @@ -2081,9 +2081,9 @@ end @test signif(Float16(1.1), 70) === Float16(1.1) end @testset "issue #1308" begin - @test hex(~UInt128(0)) == "f"^32 - @test (~0)%UInt128 == ~UInt128(0) - @test Int128(~0) == ~Int128(0) + @test hex(!UInt128(0)) == "f"^32 + @test (!0)%UInt128 == !UInt128(0) + @test Int128(!0) == !Int128(0) end @testset "issue 1552" begin @test isa(rationalize(Int8, float(pi)), Rational{Int8}) @@ -2311,7 +2311,7 @@ end @testset "ispow2" begin @test ispow2(64) @test !ispow2(42) - @test !ispow2(~typemax(Int)) + @test !ispow2(!typemax(Int)) end @testset "nextpow/prevpow" begin @test nextpow(2,1) == 1 @@ -2900,8 +2900,8 @@ end let types = (Base.BitInteger_types..., BigInt, Bool) for S in types - T = @inferred Base.promote_op(~, S) - t = @inferred ~one(S) + T = @inferred Base.promote_op(!, S) + t = @inferred !one(S) @test T === typeof(t) for R in types diff --git a/test/ranges.jl b/test/ranges.jl index c12bb55473aa1..fe4133a4e8ee2 100644 --- a/test/ranges.jl +++ b/test/ranges.jl @@ -1056,7 +1056,7 @@ end @test size(similar(r, size(r))) == size(similar(r, length(r))) end end -@testset "sign, conj, ~ (Issue #16067)" begin +@testset "sign, conj, ! (Issue #16067)" begin A = -1:1 B = -1.0:1.0 @test sign.(A) == [-1,0,1] @@ -1067,8 +1067,8 @@ end @test conj(A) === A @test conj(B) === B - @test .~A == [0,-1,-2] - @test typeof(.~A) == Vector{Int} + @test .!A == [0,-1,-2] + @test typeof(.!A) == Vector{Int} end @testset "conversion to Array" begin diff --git a/test/show.jl b/test/show.jl index 8403706b7342a..65db373528bc2 100644 --- a/test/show.jl +++ b/test/show.jl @@ -68,7 +68,7 @@ end @test_repr "2e" @test_repr "!x" @test_repr "f(1, 2, 3)" -@test_repr "x = ~y" +@test_repr "x = !y" @test_repr ":(:x, :y)" @test_repr ":(:(:(x)))" @@ -209,17 +209,17 @@ end""" # line meta if delta_kd == 0 # line meta - msk_d0 = ~(u << ld0) | (u << ld1 << 1) + msk_d0 = !(u << ld0) | (u << ld1 << 1) else # line meta - msk_d0 = ~(u << ld0) + msk_d0 = !(u << ld0) # line meta msk_d1 = (u << ld1 << 1) end # line meta if delta_ks == 0 # line meta - msk_s0 = (u << ls0) & ~(u << ls1 << 1) + msk_s0 = (u << ls0) & !(u << ls1 << 1) else # line meta msk_s0 = (u << ls0) @@ -227,7 +227,7 @@ end""" # line meta chunk_s0 = glue_src_bitchunks(src, ks0, ks1, msk_s0, ls0) # line meta - dest[kd0] = (dest[kd0] & msk_d0) | ((chunk_s0 << ld0) & ~msk_d0) + dest[kd0] = (dest[kd0] & msk_d0) | ((chunk_s0 << ld0) & !msk_d0) # line meta if delta_kd == 0 # line meta @@ -255,7 +255,7 @@ end""" # line meta chunk_s = (chunk_s0 >>> (63 - ld0) >>> 1) | (chunk_s1 << ld0) # line meta - dest[kd1] = (dest[kd1] & msk_d1) | (chunk_s & ~msk_d1) + dest[kd1] = (dest[kd1] & msk_d1) | (chunk_s & !msk_d1) # line meta return end""" @@ -813,7 +813,7 @@ test_repr(":a.b") test_repr("a.:+") test_repr("(+).a") test_repr("(+).:-") -test_repr("(!).:~") +test_repr("(!).:-") test_repr("a.:(begin #= none:3 =# end)") diff --git a/test/version.jl b/test/version.jl index e45639fe16c69..7f21cc7065f2c 100644 --- a/test/version.jl +++ b/test/version.jl @@ -103,18 +103,18 @@ end # issupbuild import Base.issupbuild @test issupbuild(v"4.3.2+") -@test ~issupbuild(v"4.3.2") -@test ~issupbuild(v"4.3.2-") -@test ~issupbuild(v"4.3.2-a") -@test ~issupbuild(v"4.3.2-a1") -@test ~issupbuild(v"4.3.2-1") -@test ~issupbuild(v"4.3.2-a.1") -@test ~issupbuild(v"4.3.2-1a") -@test ~issupbuild(v"4.3.2+a") -@test ~issupbuild(v"4.3.2+a1") -@test ~issupbuild(v"4.3.2+1") -@test ~issupbuild(v"4.3.2+a.1") -@test ~issupbuild(v"4.3.2+1a") +@test !issupbuild(v"4.3.2") +@test !issupbuild(v"4.3.2-") +@test !issupbuild(v"4.3.2-a") +@test !issupbuild(v"4.3.2-a1") +@test !issupbuild(v"4.3.2-1") +@test !issupbuild(v"4.3.2-a.1") +@test !issupbuild(v"4.3.2-1a") +@test !issupbuild(v"4.3.2+a") +@test !issupbuild(v"4.3.2+a1") +@test !issupbuild(v"4.3.2+1") +@test !issupbuild(v"4.3.2+a.1") +@test !issupbuild(v"4.3.2+1a") # basic comparison VersionNumber(2, 3, 1) == VersionNumber(Int8(2), UInt32(3), Int32(1)) == v"2.3.1"