Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into nhd-test-logs-threa…
Browse files Browse the repository at this point in the history
…d-safe
  • Loading branch information
NHDaly committed May 22, 2024
2 parents 0053794 + e89c21b commit 31e4ac1
Show file tree
Hide file tree
Showing 73 changed files with 1,711 additions and 772 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Standard library changes
#### LinearAlgebra

* `rank` can now take a `QRPivoted` matrix to allow rank estimation via QR factorization ([#54283]).
* Added keyword argument `alg` to `eigen`, `eigen!`, `eigvals` and `eigvals!` for self-adjoint
matrix types (i.e., the type union `RealHermSymComplexHerm`) that allows one to switch
between different eigendecomposition algorithms ([#49355]).

#### Logging

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ and then use the command prompt to change into the resulting julia directory. By
Julia. However, most users should use the [most recent stable version](https://github.com/JuliaLang/julia/releases)
of Julia. You can get this version by running:

git checkout v1.10.2
git checkout v1.10.3

To build the `julia` executable, run `make` from within the julia directory.

Expand Down
4 changes: 2 additions & 2 deletions base/deepcopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ end

function deepcopy_internal(x::AbstractLock, stackdict::IdDict)
if haskey(stackdict, x)
return stackdict[x]
return stackdict[x]::typeof(x)
end
y = typeof(x)()
stackdict[x] = y
Expand All @@ -166,7 +166,7 @@ end

function deepcopy_internal(x::GenericCondition, stackdict::IdDict)
if haskey(stackdict, x)
return stackdict[x]
return stackdict[x]::typeof(x)
end
y = typeof(x)(deepcopy_internal(x.lock, stackdict))
stackdict[x] = y
Expand Down
5 changes: 3 additions & 2 deletions base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,9 @@ Stacktrace:
[...]
```
If `T` is a [`AbstractFloat`](@ref) type,
then it will return the closest value to `x` representable by `T`.
If `T` is a [`AbstractFloat`](@ref) type, then it will return the
closest value to `x` representable by `T`. Inf is treated as one
ulp greater than `floatmax(T)` for purposes of determining nearest.
```jldoctest
julia> x = 1/3
Expand Down
13 changes: 13 additions & 0 deletions base/float.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,19 @@ round(x::IEEEFloat, ::RoundingMode{:Down}) = floor_llvm(x)
round(x::IEEEFloat, ::RoundingMode{:Up}) = ceil_llvm(x)
round(x::IEEEFloat, ::RoundingMode{:Nearest}) = rint_llvm(x)

rounds_up(x, ::RoundingMode{:Down}) = false
rounds_up(x, ::RoundingMode{:Up}) = true
rounds_up(x, ::RoundingMode{:ToZero}) = signbit(x)
rounds_up(x, ::RoundingMode{:FromZero}) = !signbit(x)
function _round_convert(::Type{T}, x_integer, x, r::Union{RoundingMode{:ToZero}, RoundingMode{:FromZero}, RoundingMode{:Up}, RoundingMode{:Down}}) where {T<:AbstractFloat}
x_t = convert(T, x_integer)
if rounds_up(x, r)
x_t < x ? nextfloat(x_t) : x_t
else
x_t > x ? prevfloat(x_t) : x_t
end
end

## floating point promotions ##
promote_rule(::Type{Float32}, ::Type{Float16}) = Float32
promote_rule(::Type{Float64}, ::Type{Float16}) = Float64
Expand Down
2 changes: 1 addition & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ Base.add_with_overflow(a::BigInt, b::BigInt) = a + b, false
Base.sub_with_overflow(a::BigInt, b::BigInt) = a - b, false
Base.mul_with_overflow(a::BigInt, b::BigInt) = a * b, false

Base.deepcopy_internal(x::BigInt, stackdict::IdDict) = get!(() -> MPZ.set(x), stackdict, x)
Base.deepcopy_internal(x::BigInt, stackdict::IdDict) = get!(() -> MPZ.set(x), stackdict, x)::BigInt

## streamlined hashing for BigInt, by avoiding allocation from shifts ##

Expand Down
2 changes: 1 addition & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ The endianness of the written value depends on the endianness of the host system
Convert to/from a fixed endianness when writing/reading (e.g. using [`htol`](@ref) and
[`ltoh`](@ref)) to get results that are consistent across platforms.
You can write multiple values with the same `write` call. i.e. the following are equivalent:
You can write multiple values with the same `write` call, i.e. the following are equivalent:
write(io, x, y...)
write(io, x) + write(io, y...)
Expand Down
2 changes: 1 addition & 1 deletion base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ function Base.deepcopy_internal(x::BigFloat, stackdict::IdDict)
y = _BigFloat(x.prec, x.sign, x.exp, d′)
#ccall((:mpfr_custom_move,libmpfr), Cvoid, (Ref{BigFloat}, Ptr{Limb}), y, d) # unnecessary
return y
end
end::BigFloat
end

function decompose(x::BigFloat)::Tuple{BigInt, Int, Int}
Expand Down
1 change: 1 addition & 0 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module IteratorsMD
oneunit(::Type{CartesianIndex{N}}) where {N} = CartesianIndex(ntuple(Returns(1), Val(N)))

# arithmetic, min/max
@inline (+)(index::CartesianIndex) = index
@inline (-)(index::CartesianIndex{N}) where {N} =
CartesianIndex{N}(map(-, index.I))
@inline (+)(index1::CartesianIndex{N}, index2::CartesianIndex{N}) where {N} =
Expand Down
1 change: 1 addition & 0 deletions base/ntuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ julia> ntuple(i -> 2*i, Val(4))
Tuple(f(i) for i = 1:N)
end
end
typeof(function ntuple end).name.max_methods = UInt8(5)

@inline function fill_to_length(t::Tuple, val, ::Val{_N}) where {_N}
M = length(t)
Expand Down
13 changes: 12 additions & 1 deletion base/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ The [`RoundingMode`](@ref) `r` controls the direction of the rounding; the defau
of 0.5) being rounded to the nearest even integer. Note that `round` may give incorrect
results if the global rounding mode is changed (see [`rounding`](@ref)).
When rounding to a floating point type, will round to integers representable by that type
(and Inf) rather than true integers. Inf is treated as one ulp greater than the
`floatmax(T)` for purposes of determining "nearest", similar to [`convert`](@ref).
# Examples
```jldoctest
julia> round(1.7)
Expand All @@ -363,6 +367,12 @@ julia> round(123.456; sigdigits=2)
julia> round(357.913; sigdigits=4, base=2)
352.0
julia> round(Float16, typemax(UInt128))
Inf16
julia> floor(Float16, typemax(UInt128))
Float16(6.55e4)
```
!!! note
Expand Down Expand Up @@ -466,6 +476,7 @@ floor(::Type{T}, x) where T = round(T, x, RoundDown)
ceil(::Type{T}, x) where T = round(T, x, RoundUp)
round(::Type{T}, x) where T = round(T, x, RoundNearest)

round(::Type{T}, x, r::RoundingMode) where T = convert(T, round(x, r))
round(::Type{T}, x, r::RoundingMode) where T = _round_convert(T, round(x, r), x, r)
_round_convert(::Type{T}, x_integer, x, r) where T = convert(T, x_integer)

round(x::Integer, r::RoundingMode) = x
2 changes: 1 addition & 1 deletion base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ end
"""
isdigit(c::AbstractChar) -> Bool
Tests whether a character is a decimal digit (0-9).
Tests whether a character is an ASCII decimal digit (`0`-`9`).
See also: [`isletter`](@ref).
Expand Down
3 changes: 0 additions & 3 deletions contrib/asan/Make.user.asan
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ override SANITIZE_ADDRESS=1
# make the GC use regular malloc/frees, which are hooked by ASAN
override WITH_GC_DEBUG_ENV=1

# default to a debug build for better line number reporting
override JULIA_BUILD_MODE=debug

# Enable Julia assertions and LLVM assertions
FORCE_ASSERTIONS=1
LLVM_ASSERTIONS=1
Expand Down
Loading

0 comments on commit 31e4ac1

Please sign in to comment.