Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few "See also" entries to typemax and friends #57759

Merged
merged 6 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion base/float.jl
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,8 @@ end
Return the smallest positive normal number representable by the floating-point
type `T`.

See also: [`typemin`](@ref), [`maxintfloat`](@ref), [`floatmax`](@ref), [`eps`](@ref).

# Examples
```jldoctest
julia> floatmin(Float16)
Expand All @@ -1014,7 +1016,7 @@ floatmin(x::T) where {T<:AbstractFloat} = floatmin(T)

Return the largest finite number representable by the floating-point type `T`.

See also: [`typemax`](@ref), [`floatmin`](@ref), [`eps`](@ref).
See also: [`typemax`](@ref), [`maxintfloat`](@ref), [`floatmin`](@ref), [`eps`](@ref).

# Examples
```jldoctest
Expand Down
2 changes: 2 additions & 0 deletions base/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ That is, `maxintfloat` returns the smallest positive integer-valued floating-poi
`n` such that `n+1` is *not* exactly representable in the type `T`.

When an `Integer`-type value is needed, use `Integer(maxintfloat(T))`.

See also: [`typemax`](@ref), [`floatmax`](@ref).
"""
maxintfloat(::Type{Float64}) = 9007199254740992.
maxintfloat(::Type{Float32}) = Float32(16777216.)
Expand Down
13 changes: 8 additions & 5 deletions base/int.jl
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ promote_rule(::Type{UInt128}, ::Type{Int128}) = UInt128

The lowest value representable by the given (real) numeric DataType `T`.

See also: [`floatmin`](@ref), [`typemax`](@ref), [`eps`](@ref).
See also: [`floatmin`](@ref), [`maxintfloat`](@ref), [`typemax`](@ref), [`eps`](@ref).

# Examples
```jldoctest
Expand All @@ -764,8 +764,11 @@ julia> typemin(Float16)
julia> typemin(Float32)
-Inf32

julia> nextfloat(-Inf32) # smallest finite Float32 floating point number
-3.4028235f38
julia> floatmin(Float32) # smallest positive finite Float32 floating point number
1.1754944f-38

julia> nextfloat(-Inf32) == -floatmax(Float32) # equivalent ways of getting the lowest finite Float32 floating point number
true
```
"""
function typemin end
Expand All @@ -775,7 +778,7 @@ function typemin end

The highest value representable by the given (real) numeric `DataType`.

See also: [`floatmax`](@ref), [`typemin`](@ref), [`eps`](@ref).
See also: [`floatmax`](@ref), [`maxintfloat`](@ref), [`typemin`](@ref), [`eps`](@ref).

# Examples
```jldoctest
Expand All @@ -791,7 +794,7 @@ Inf
julia> typemax(Float32)
Inf32

julia> floatmax(Float32) # largest finite Float32 floating point number
julia> floatmax(Float32) # largest positive finite Float32 floating point number
3.4028235f38
```
"""
Expand Down