diff --git a/Compiler/src/abstractlattice.jl b/Compiler/src/abstractlattice.jl index 4d0accedfc765..d9cccdb880c7d 100644 --- a/Compiler/src/abstractlattice.jl +++ b/Compiler/src/abstractlattice.jl @@ -183,7 +183,7 @@ end """ has_nontrivial_extended_info(𝕃::AbstractLattice, t)::Bool -Determines whether the given lattice element `t` of `𝕃` has non-trivial extended lattice +Determine whether the given lattice element `t` of `𝕃` has non-trivial extended lattice information that would not be available from the type itself. """ @nospecializeinfer has_nontrivial_extended_info(𝕃::AbstractLattice, @nospecialize t) = @@ -206,7 +206,7 @@ end """ is_const_prop_profitable_arg(𝕃::AbstractLattice, t)::Bool -Determines whether the given lattice element `t` of `𝕃` has new extended lattice information +Determine whether the given lattice element `t` of `𝕃` has new extended lattice information that should be forwarded along with constant propagation. """ @nospecializeinfer is_const_prop_profitable_arg(𝕃::AbstractLattice, @nospecialize t) = diff --git a/Compiler/src/ssair/EscapeAnalysis.jl b/Compiler/src/ssair/EscapeAnalysis.jl index d78ec529cbd9f..75dfc42e5ddcd 100644 --- a/Compiler/src/ssair/EscapeAnalysis.jl +++ b/Compiler/src/ssair/EscapeAnalysis.jl @@ -415,7 +415,7 @@ end """ iridx(x, estate::EscapeState) -> xidx::Union{Int,Nothing} -Tries to convert analyzable IR element `x::Union{Argument,SSAValue}` to +Try to convert analyzable IR element `x::Union{Argument,SSAValue}` to its unique identifier number `xidx` that is valid in the analysis context of `estate`. Returns `nothing` if `x` isn't maintained by `estate` and thus unanalyzable (e.g. `x::GlobalRef`). diff --git a/Compiler/src/ssair/domtree.jl b/Compiler/src/ssair/domtree.jl index 38a07da5fb075..480d38f2bb218 100644 --- a/Compiler/src/ssair/domtree.jl +++ b/Compiler/src/ssair/domtree.jl @@ -597,7 +597,7 @@ end """ dominates(domtree::DomTree, bb1::Int, bb2::Int)::Bool -Checks if `bb1` dominates `bb2`. +Check if `bb1` dominates `bb2`. `bb1` and `bb2` are indexes into the `CFG` blocks. `bb1` dominates `bb2` if the only way to enter `bb2` is via `bb1`. (Other blocks may be in between, e.g `bb1->bbx->bb2`). @@ -608,7 +608,7 @@ dominates(domtree::DomTree, bb1::BBNumber, bb2::BBNumber) = """ postdominates(domtree::PostDomTree, bb1::Int, bb2::Int)::Bool -Checks if `bb1` post-dominates `bb2`. +Check if `bb1` post-dominates `bb2`. `bb1` and `bb2` are indexes into the `CFG` blocks. `bb1` post-dominates `bb2` if every pass from `bb2` to the exit is via `bb1`. (Other blocks may be in between, e.g `bb2->bbx->bb1->exit`). diff --git a/base/abstractset.jl b/base/abstractset.jl index 315260e16d2d1..f9dc19811d495 100644 --- a/base/abstractset.jl +++ b/base/abstractset.jl @@ -401,7 +401,7 @@ function ⊋ end ⊊(a, b)::Bool ⊋(b, a)::Bool -Determines if `a` is a subset of, but not equal to, `b`. +Determine if `a` is a subset of, but not equal to, `b`. See also [`issubset`](@ref) (`⊆`), [`⊈`](@ref). diff --git a/base/channels.jl b/base/channels.jl index 5b57a6202dc2f..bfb393e0265b4 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -13,7 +13,7 @@ popfirst!(c::AbstractChannel) = take!(c) """ Channel{T=Any}(size::Int=0) -Constructs a `Channel` with an internal buffer that can hold a maximum of `size` objects +Construct a `Channel` with an internal buffer that can hold a maximum of `size` objects of type `T`. [`put!`](@ref) calls on a full channel block until an object is removed with [`take!`](@ref). @@ -214,7 +214,7 @@ end """ isopen(c::Channel) -Determines whether a [`Channel`](@ref) is open for new [`put!`](@ref) operations. +Determine whether a [`Channel`](@ref) is open for new [`put!`](@ref) operations. Notice that a `Channel` can be closed and still have buffered elements which can be consumed with [`take!`](@ref). @@ -555,7 +555,7 @@ end """ isready(c::Channel) -Determines whether a [`Channel`](@ref) has a value stored in it. +Determine whether a [`Channel`](@ref) has a value stored in it. Returns immediately, does not block. For unbuffered channels, return `true` if there are tasks waiting on a [`put!`](@ref). @@ -600,7 +600,7 @@ end """ isfull(c::Channel) -Determines if a [`Channel`](@ref) is full, in the sense +Determine if a [`Channel`](@ref) is full, in the sense that calling `put!(c, some_value)` would have blocked. Returns immediately, does not block. @@ -646,7 +646,7 @@ trylock(c::Channel) = trylock(c.cond_take) """ wait(c::Channel) -Blocks until the `Channel` [`isready`](@ref). +Block until the `Channel` [`isready`](@ref). ```jldoctest julia> c = Channel(1); diff --git a/base/deprecated.jl b/base/deprecated.jl index 241888ba45471..5da1ca8128976 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -538,7 +538,7 @@ end """ isbindingresolved(m::Module, s::Symbol) -> Bool -Returns whether the binding of a symbol in a module is resolved. +Return whether the binding of a symbol in a module is resolved. See also: [`isexported`](@ref), [`ispublic`](@ref), [`isdeprecated`](@ref) diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index c4dcc90baf945..99316e51cf260 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -3199,7 +3199,7 @@ undef """ Ptr{T}() -Creates a null pointer to type `T`. +Create a null pointer to type `T`. """ Ptr{T}() diff --git a/base/essentials.jl b/base/essentials.jl index 2f6faadea08a6..797c247949147 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -508,7 +508,7 @@ pairs(::Type{NamedTuple}) = Pairs{Symbol, V, Nothing, NT} where {V, NT <: NamedT """ Base.Pairs(values, keys) <: AbstractDict{eltype(keys), eltype(values)} -Transforms an indexable container into a Dictionary-view of the same data. +Transform an indexable container into a Dictionary-view of the same data. Modifying the key-space of the underlying data may invalidate this object. """ Pairs diff --git a/base/experimental.jl b/base/experimental.jl index 730a42eb1717d..fa7dabf184409 100644 --- a/base/experimental.jl +++ b/base/experimental.jl @@ -34,7 +34,7 @@ Base.axes(C::Const) = axes(C.a) """ @aliasscope expr -Allows the compiler to assume that all `Const`s are not being modified through stores +Allow the compiler to assume that all `Const`s are not being modified through stores within this scope, even if the compiler can't prove this to be the case. !!! warning @@ -543,7 +543,7 @@ This metric is only updated when `t` yields or completes unless `t` is the curre which it will be updated continuously. See also [`Base.Experimental.task_wall_time_ns`](@ref). -Returns `nothing` if task timings are not enabled. +Return `nothing` if task timings are not enabled. See [`Base.Experimental.task_metrics`](@ref). !!! note "This metric is from the Julia scheduler" @@ -572,7 +572,7 @@ This is the time since the task first entered the run queue until the time at wh completed, or until the current time if the task has not yet completed. See also [`Base.Experimental.task_running_time_ns`](@ref). -Returns `nothing` if task timings are not enabled. +Return `nothing` if task timings are not enabled. See [`Base.Experimental.task_metrics`](@ref). !!! compat "Julia 1.12" diff --git a/base/file.jl b/base/file.jl index efc642b099b6a..b57aa3611a9d3 100644 --- a/base/file.jl +++ b/base/file.jl @@ -554,7 +554,7 @@ end """ tempdir() -Gets the path of the temporary directory. On Windows, `tempdir()` uses the first environment +Get the path of the temporary directory. On Windows, `tempdir()` uses the first environment variable found in the ordered list `TMP`, `TEMP`, `USERPROFILE`. On all other operating systems, `tempdir()` uses the first environment variable found in the ordered list `TMPDIR`, `TMP`, `TEMP`, and `TEMPDIR`. If none of these are found, the path `"/tmp"` is used. @@ -1297,7 +1297,7 @@ end """ hardlink(src::AbstractString, dst::AbstractString) -Creates a hard link to an existing source file `src` with the name `dst`. The +Create a hard link to an existing source file `src` with the name `dst`. The destination, `dst`, must not exist. See also: [`symlink`](@ref). @@ -1317,7 +1317,7 @@ end """ symlink(target::AbstractString, link::AbstractString; dir_target = false) -Creates a symbolic link to `target` with the name `link`. +Create a symbolic link to `target` with the name `link`. On Windows, symlinks must be explicitly declared as referring to a directory or not. If `target` already exists, by default the type of `link` will be auto- @@ -1490,7 +1490,7 @@ Base.show(io::IO, x::DiskStat) = """ diskstat(path=pwd()) -Returns statistics in bytes about the disk that contains the file or directory pointed at by +Return statistics in bytes about the disk that contains the file or directory pointed at by `path`. If no argument is passed, statistics about the disk that contains the current working directory are returned. diff --git a/base/floatfuncs.jl b/base/floatfuncs.jl index 437f8ae0157ec..5bc4ae9827d4f 100644 --- a/base/floatfuncs.jl +++ b/base/floatfuncs.jl @@ -273,7 +273,7 @@ end """ fma(x, y, z) -Computes `x*y+z` without rounding the intermediate result `x*y`. On some systems this is +Compute `x*y+z` without rounding the intermediate result `x*y`. On some systems this is significantly more expensive than `x*y+z`. `fma` is used to improve accuracy in certain algorithms. See [`muladd`](@ref). """ diff --git a/base/gcutils.jl b/base/gcutils.jl index d5e6f4597739f..67ae7cc7a837c 100644 --- a/base/gcutils.jl +++ b/base/gcutils.jl @@ -169,7 +169,7 @@ end """ GC.in_finalizer()::Bool -Returns `true` if the current task is running a finalizer, returns `false` +Return `true` if the current task is running a finalizer, return `false` otherwise. Will also return `false` within a finalizer which was inlined by the compiler's eager finalization optimization, or if `finalize` is called on the finalizer directly. diff --git a/base/int.jl b/base/int.jl index fc6b26fbf4dfb..c7c542d261157 100644 --- a/base/int.jl +++ b/base/int.jl @@ -100,7 +100,7 @@ inv(x::Integer) = float(one(x)) / float(x) """ mul_hi(a::T, b::T) where {T<:Base.Integer} -Returns the higher half of the product of `a` and `b` where `T` is a fixed size integer. +Return the higher half of the product of `a` and `b` where `T` is a fixed size integer. # Examples ```jldoctest diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 49df2b849e60d..e56cc63e4ff75 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -190,7 +190,7 @@ end """ gcdx(a, b...) -Computes the greatest common (positive) divisor of `a` and `b` and their Bézout +Compute the greatest common (positive) divisor of `a` and `b` and their Bézout coefficients, i.e. the integer coefficients `u` and `v` that satisfy ``u*a + v*b = d = gcd(a, b)``. ``gcdx(a, b)`` returns ``(d, u, v)``. diff --git a/base/libc.jl b/base/libc.jl index f04609618158a..a24253242192c 100644 --- a/base/libc.jl +++ b/base/libc.jl @@ -280,7 +280,7 @@ end """ time(t::TmStruct)::Float64 -Converts a `TmStruct` struct to a number of seconds since the epoch. +Convert a `TmStruct` struct to a number of seconds since the epoch. """ time(tm::TmStruct) = Float64(ccall(:mktime, Int, (Ref{TmStruct},), tm)) diff --git a/base/loading.jl b/base/loading.jl index a1fa054d20f21..13015e80bcce4 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1934,7 +1934,7 @@ end """ Base.isprecompiled(pkg::PkgId; ignore_loaded::Bool=false) -Returns whether a given PkgId within the active project is precompiled. +Return whether a given PkgId within the active project is precompiled. By default this check observes the same approach that code loading takes with respect to when different versions of dependencies are currently loaded @@ -1952,7 +1952,7 @@ end """ Base.isrelocatable(pkg::PkgId) -Returns whether a given PkgId within the active project is precompiled and the +Return whether a given PkgId within the active project is precompiled and the associated cache is relocatable. !!! compat "Julia 1.11" @@ -3302,7 +3302,7 @@ end """ Base.compilecache(module::PkgId) -Creates a precompiled cache file for a module and all of its dependencies. +Create a precompiled cache file for a module and all of its dependencies. This can be used to reduce package load times. Cache files are stored in `DEPOT_PATH[1]/compiled`. See [Module initialization and precompilation](@ref) for important notes. diff --git a/base/lock.jl b/base/lock.jl index e47e03c2bd1fa..15586f8ed6eec 100644 --- a/base/lock.jl +++ b/base/lock.jl @@ -21,7 +21,7 @@ const MAX_SPIN_ITERS = 40 """ ReentrantLock() -Creates a re-entrant lock for synchronizing [`Task`](@ref)s. The same task can +Create a re-entrant lock for synchronizing [`Task`](@ref)s. The same task can acquire the lock as many times as required (this is what the "Reentrant" part of the name means). Each [`lock`](@ref) must be matched with an [`unlock`](@ref). @@ -400,7 +400,7 @@ end """ Lockable(value, lock = ReentrantLock()) -Creates a `Lockable` object that wraps `value` and +Create a `Lockable` object that wraps `value` and associates it with the provided `lock`. This object supports [`@lock`](@ref), [`lock`](@ref), [`trylock`](@ref), [`unlock`](@ref). To access the value, index the lockable object while diff --git a/base/rational.jl b/base/rational.jl index 8daa3e9446ab8..35c815e989075 100644 --- a/base/rational.jl +++ b/base/rational.jl @@ -52,7 +52,7 @@ Rational(n::Integer) = unsafe_rational(n, one(n)) """ divgcd(x::Integer, y::Integer) -Returns `(x÷gcd(x,y), y÷gcd(x,y))`. +Return `(x÷gcd(x,y), y÷gcd(x,y))`. See also [`div`](@ref), [`gcd`](@ref). """ diff --git a/base/rawbigfloats.jl b/base/rawbigfloats.jl index 4377edfc463d8..a8b46b313bdb1 100644 --- a/base/rawbigfloats.jl +++ b/base/rawbigfloats.jl @@ -30,7 +30,7 @@ word_is_nonzero(x::BigFloatData, v::Val) = let x = x end """ -Returns a `Bool` indicating whether the `len` least significant words +Return a `Bool` indicating whether the `len` least significant words of `x` are nonzero. """ function tail_is_nonzero(x::BigFloatData, len::Int, ::Val{:words}) @@ -38,7 +38,7 @@ function tail_is_nonzero(x::BigFloatData, len::Int, ::Val{:words}) end """ -Returns a `Bool` indicating whether the `len` least significant bits of +Return a `Bool` indicating whether the `len` least significant bits of the `i`-th (zero-based index) word of `x` are nonzero. """ function tail_is_nonzero(x::BigFloatData, len::Int, i::Int, ::Val{:word}) @@ -47,7 +47,7 @@ function tail_is_nonzero(x::BigFloatData, len::Int, i::Int, ::Val{:word}) end """ -Returns a `Bool` indicating whether the `len` least significant bits of +Return a `Bool` indicating whether the `len` least significant bits of `x` are nonzero. """ function tail_is_nonzero(x::BigFloatData, len::Int, ::Val{:bits}) @@ -61,14 +61,14 @@ function tail_is_nonzero(x::BigFloatData, len::Int, ::Val{:bits}) end """ -Returns a `Bool` that is the `i`-th (zero-based index) bit of `x`. +Return a `Bool` that is the `i`-th (zero-based index) bit of `x`. """ function get_elem(x::Unsigned, i::Int, ::Val{:bits}, ::Val{:ascending}) (x >>> i) % Bool end """ -Returns a `Bool` that is the `i`-th (zero-based index) bit of `x`. +Return a `Bool` that is the `i`-th (zero-based index) bit of `x`. """ function get_elem(x::BigFloatData, i::Int, ::Val{:bits}, v::Val{:ascending}) vb = Val(:bits) @@ -82,7 +82,7 @@ function get_elem(x::BigFloatData, i::Int, ::Val{:bits}, v::Val{:ascending}) end """ -Returns an integer of type `R`, consisting of the `len` most +Return an integer of type `R`, consisting of the `len` most significant bits of `x`. If there are less than `len` bits in `x`, the least significant bits are zeroed. """ diff --git a/base/reflection.jl b/base/reflection.jl index 3309a9a346db1..03e1d4c71e393 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -211,7 +211,7 @@ end """ code_typed(f, types; kw...) -Returns an array of type-inferred lowered form (IR) for the methods matching the given +Return an array of type-inferred lowered form (IR) for the methods matching the given generic function and type signature. # Keyword Arguments @@ -618,7 +618,7 @@ end world::UInt=get_world_counter(), interp::Core.Compiler.AbstractInterpreter=Core.Compiler.NativeInterpreter(world)) -> rt::Type -Returns an inferred return type of the function call specified by `f` and `types`. +Return an inferred return type of the function call specified by `f` and `types`. # Arguments - `f`: The function to analyze. @@ -764,7 +764,7 @@ end world::UInt=get_world_counter(), interp::Core.Compiler.AbstractInterpreter=Core.Compiler.NativeInterpreter(world)) -> exct::Type -Returns the type of exception potentially thrown by the function call specified by `f` and `types`. +Return the type of exception potentially thrown by the function call specified by `f` and `types`. # Arguments - `f`: The function to analyze. @@ -833,7 +833,7 @@ end world::UInt=get_world_counter(), interp::Core.Compiler.AbstractInterpreter=Core.Compiler.NativeInterpreter(world)) -> effects::Effects -Returns the possible computation effects of the function call specified by `f` and `types`. +Return the possible computation effects of the function call specified by `f` and `types`. # Arguments - `f`: The function to analyze. @@ -963,7 +963,7 @@ end """ which(f, types) -Returns the method of `f` (a `Method` object) that would be called for arguments of the given `types`. +Return the method of `f` (a `Method` object) that would be called for arguments of the given `types`. If `types` is an abstract type, then the method that would be called by `invoke` is returned. @@ -987,7 +987,7 @@ end """ which(types::Type{<:Tuple}) -Returns the method that would be called by the given type signature (as a tuple type). +Return the method that would be called by the given type signature (as a tuple type). """ function which(@nospecialize(tt#=::Type=#)) return _which(tt).method diff --git a/base/runtime_internals.jl b/base/runtime_internals.jl index 25e174a14d204..a8841108f654d 100644 --- a/base/runtime_internals.jl +++ b/base/runtime_internals.jl @@ -122,7 +122,7 @@ unsorted_names(m::Module; all::Bool=false, imported::Bool=false, usings::Bool=fa """ isexported(m::Module, s::Symbol)::Bool -Returns whether a symbol is exported from a module. +Return whether a symbol is exported from a module. See also: [`ispublic`](@ref), [`names`](@ref) @@ -148,7 +148,7 @@ isexported(m::Module, s::Symbol) = ccall(:jl_module_exports_p, Cint, (Any, Any), """ ispublic(m::Module, s::Symbol)::Bool -Returns whether a symbol is marked as public in a module. +Return whether a symbol is marked as public in a module. Exported symbols are considered public. @@ -998,7 +998,7 @@ iskindtype(@nospecialize t) = (t === DataType || t === UnionAll || t === Union | """ Base.isconcretedispatch(T) -Returns true if `T` is a [concrete type](@ref isconcretetype) that could appear +Return true if `T` is a [concrete type](@ref isconcretetype) that could appear as an element of a [dispatch tuple](@ref isdispatchtuple). See also: [`isdispatchtuple`](@ref). @@ -1445,7 +1445,7 @@ max_world(m::Core.CodeInfo) = m.max_world """ get_world_counter() -Returns the current maximum world-age counter. This counter is monotonically +Return the current maximum world-age counter. This counter is monotonically increasing. !!! warning @@ -1459,7 +1459,7 @@ get_world_counter() = ccall(:jl_get_world_counter, UInt, ()) """ tls_world_age() -Returns the world the [current_task()](@ref) is executing within. +Return the world the [current_task()](@ref) is executing within. """ tls_world_age() = ccall(:jl_get_tls_world_age, UInt, ()) @@ -1652,7 +1652,7 @@ ast_slotflag(@nospecialize(code), i) = ccall(:jl_ir_slotflag, UInt8, (Any, Csize """ may_invoke_generator(method, atype, sparams)::Bool -Computes whether or not we may invoke the generator for the given `method` on +Compute whether or not we may invoke the generator for the given `method` on the given `atype` and `sparams`. For correctness, all generated function are required to return monotonic answers. However, since we don't expect users to be able to successfully implement this criterion, we only call generated diff --git a/base/ryu/utils.jl b/base/ryu/utils.jl index 2064dfbefcecd..7902d1ca94206 100644 --- a/base/ryu/utils.jl +++ b/base/ryu/utils.jl @@ -22,7 +22,7 @@ qbound(::Type{Float64}) = 63 """ Ryu.log10pow2(e::Integer) -Computes `floor(log10(2^e))`. This is valid for all `e < 1651`. +Compute `floor(log10(2^e))`. This is valid for all `e < 1651`. """ log10pow2(e) = (e * 78913) >> 18 @@ -30,14 +30,14 @@ log10pow2(e) = (e * 78913) >> 18 """ Ryu.log10pow5(e::Integer) -Computes `floor(log10(5^e))`. This is valid for all `e < 2621`. +Compute `floor(log10(5^e))`. This is valid for all `e < 2621`. """ log10pow5(e) = (e * 732923) >> 20 """ Ryu.pow5bits(e) -Computes `e == 0 ? 1 : ceil(log2(5^e))`. This is valid for `e < 3529` (if performend in `Int32` arithmetic). +Compute `e == 0 ? 1 : ceil(log2(5^e))`. This is valid for `e < 3529` (if performend in `Int32` arithmetic). """ pow5bits(e) = ((e * 1217359) >> 19) + 1 diff --git a/base/sort.jl b/base/sort.jl index f434aa3ed4e88..685caa25a33f6 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -496,7 +496,7 @@ end """ make_scratch(scratch::Union{Nothing, Vector}, T::Type, len::Integer) -Returns `(s, t)` where `t` is an `AbstractVector` of type `T` with length at least `len` +Return `(s, t)` where `t` is an `AbstractVector` of type `T` with length at least `len` that is backed by the `Vector` `s`. If `scratch !== nothing`, then `s === scratch`. This function will allocate a new vector if `scratch === nothing`, `resize!` `scratch` if it @@ -763,7 +763,7 @@ end """ IsUIntMappable(yes, no) isa Base.Sort.Algorithm -Determines if the elements of a vector can be mapped to unsigned integers while preserving +Determine if the elements of a vector can be mapped to unsigned integers while preserving their order under the specified ordering. If they can be, dispatch to the `yes` algorithm and record the unsigned integer type that diff --git a/base/special/rem_pio2.jl b/base/special/rem_pio2.jl index b0a17fdc25087..2bbe400aaec25 100644 --- a/base/special/rem_pio2.jl +++ b/base/special/rem_pio2.jl @@ -97,6 +97,7 @@ end """ fromfraction(f::Int128) + Compute a tuple of values `(z1,z2)` such that ``z1 + z2 == f / 2^128`` and the significand of `z1` has 27 trailing zeros. @@ -211,6 +212,7 @@ end """ rem_pio2_kernel(x::Union{Float32, Float64}) + Calculate `x` divided by `π/2` accurately for arbitrarily large `x`. Returns a pair `(k, r)`, where `k` is the quadrant of the result (multiple of π/2) and `r` is the remainder, such that ``k * π/2 = x - r``. diff --git a/base/special/trig.jl b/base/special/trig.jl index a972c762975bc..2119d5a356f3c 100644 --- a/base/special/trig.jl +++ b/base/special/trig.jl @@ -64,7 +64,7 @@ const DS6 = 1.58969099521155010221e-10 """ sin_kernel(yhi, ylo) -Computes the sine on the interval [-π/4; π/4]. +Compute the sine on the interval [-π/4; π/4]. """ @inline function sin_kernel(y::DoubleFloat64) y² = y.hi*y.hi diff --git a/base/strings/cstring.jl b/base/strings/cstring.jl index aae8a6025d968..8da67d7f7bc14 100644 --- a/base/strings/cstring.jl +++ b/base/strings/cstring.jl @@ -109,7 +109,7 @@ if ccall(:jl_get_UNAME, Any, ()) === :NT """ Base.cwstring(s) -Converts a string `s` to a NUL-terminated `Vector{Cwchar_t}`, suitable for passing to C +Convert a string `s` to a NUL-terminated `Vector{Cwchar_t}`, suitable for passing to C functions expecting a `Ptr{Cwchar_t}`. The main advantage of using this over the implicit conversion provided by [`Cwstring`](@ref) is if the function is called multiple times with the same argument. diff --git a/base/sysinfo.jl b/base/sysinfo.jl index b77c312e3f2c9..ca67695e7e31c 100644 --- a/base/sysinfo.jl +++ b/base/sysinfo.jl @@ -361,7 +361,7 @@ end """ Sys.uptime() -Gets the current system uptime in seconds. +Get the current system uptime in seconds. """ function uptime() uptime_ = Ref{Float64}() diff --git a/base/task.jl b/base/task.jl index 9841bd947fdee..244a8f70a768a 100644 --- a/base/task.jl +++ b/base/task.jl @@ -28,7 +28,7 @@ end """ capture_exception(ex, bt)::Exception -Returns an exception, possibly incorporating information from a backtrace `bt`. Defaults to returning [`CapturedException(ex, bt)`](@ref). +Return an exception, possibly incorporating information from a backtrace `bt`. Defaults to returning [`CapturedException(ex, bt)`](@ref). Used in [`asyncmap`](@ref) and [`asyncmap!`](@ref) to capture exceptions thrown during the user-supplied function call. diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 4b2981a4a78ed..ee289cc788a55 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -91,7 +91,7 @@ end """ Threads.threadpool(tid = threadid())::Symbol -Returns the specified thread's threadpool; either `:default`, `:interactive`, or `:foreign`. +Return the specified thread's threadpool; either `:default`, `:interactive`, or `:foreign`. """ function threadpool(tid = threadid()) tpid = ccall(:jl_threadpoolid, Int8, (Int16,), tid-1) @@ -101,7 +101,7 @@ end """ Threads.threadpooldescription(tid = threadid())::String -Returns the specified thread's threadpool name with extended description where appropriate. +Return the specified thread's threadpool name with extended description where appropriate. """ function threadpooldescription(tid = threadid()) threadpool_name = threadpool(tid) @@ -119,7 +119,7 @@ end """ Threads.nthreadpools()::Int -Returns the number of threadpools currently configured. +Return the number of threadpools currently configured. """ nthreadpools() = Int(unsafe_load(cglobal(:jl_n_threadpools, Cint))) @@ -147,7 +147,7 @@ end """ threadpooltids(pool::Symbol) -Returns a vector of IDs of threads in the given pool. +Return a vector of IDs of threads in the given pool. """ function threadpooltids(pool::Symbol) ni = _nthreads_in_pool(Int8(0)) @@ -163,7 +163,7 @@ end """ Threads.ngcthreads()::Int -Returns the number of GC threads currently configured. +Return the number of GC threads currently configured. This includes both mark threads and concurrent sweep threads. """ ngcthreads() = Int(unsafe_load(cglobal(:jl_n_gcthreads, Cint))) + 1 diff --git a/base/tuple.jl b/base/tuple.jl index 5a5469bf8fb6a..3cdf78fa4d135 100644 --- a/base/tuple.jl +++ b/base/tuple.jl @@ -45,7 +45,7 @@ get(f::Callable, t::Tuple, i::Integer) = i in 1:length(t) ? getindex(t, i) : f() """ setindex(t::Tuple, v, i::Integer) -Creates a new tuple similar to `t` with the value at index `i` set to `v`. +Create a new tuple similar to `t` with the value at index `i` set to `v`. Throws a `BoundsError` when out of bounds. # Examples