Skip to content

Commit 4050b97

Browse files
Add a few "See also" entries to typemax and friends (#57759)
I would find it helpful to find the names of the related float max functions from another's docstring. I kept `maxintfloat` in the `floatmin` and `typemin` docstrings since there is no `minintfloat` and I still think it would be helpful to have it there. I also fixed and example in the `typemin` docstring to be consistent with the `typemax` example.
1 parent 6eef79c commit 4050b97

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

base/float.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,8 @@ end
995995
Return the smallest positive normal number representable by the floating-point
996996
type `T`.
997997
998+
See also: [`typemin`](@ref), [`maxintfloat`](@ref), [`floatmax`](@ref), [`eps`](@ref).
999+
9981000
# Examples
9991001
```jldoctest
10001002
julia> floatmin(Float16)
@@ -1014,7 +1016,7 @@ floatmin(x::T) where {T<:AbstractFloat} = floatmin(T)
10141016
10151017
Return the largest finite number representable by the floating-point type `T`.
10161018
1017-
See also: [`typemax`](@ref), [`floatmin`](@ref), [`eps`](@ref).
1019+
See also: [`typemax`](@ref), [`maxintfloat`](@ref), [`floatmin`](@ref), [`eps`](@ref).
10181020
10191021
# Examples
10201022
```jldoctest

base/floatfuncs.jl

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ That is, `maxintfloat` returns the smallest positive integer-valued floating-poi
2626
`n` such that `n+1` is *not* exactly representable in the type `T`.
2727
2828
When an `Integer`-type value is needed, use `Integer(maxintfloat(T))`.
29+
30+
See also: [`typemax`](@ref), [`floatmax`](@ref).
2931
"""
3032
maxintfloat(::Type{Float64}) = 9007199254740992.
3133
maxintfloat(::Type{Float32}) = Float32(16777216.)

base/int.jl

+8-5
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ promote_rule(::Type{UInt128}, ::Type{Int128}) = UInt128
748748
749749
The lowest value representable by the given (real) numeric DataType `T`.
750750
751-
See also: [`floatmin`](@ref), [`typemax`](@ref), [`eps`](@ref).
751+
See also: [`floatmin`](@ref), [`maxintfloat`](@ref), [`typemax`](@ref), [`eps`](@ref).
752752
753753
# Examples
754754
```jldoctest
@@ -764,8 +764,11 @@ julia> typemin(Float16)
764764
julia> typemin(Float32)
765765
-Inf32
766766
767-
julia> nextfloat(-Inf32) # smallest finite Float32 floating point number
768-
-3.4028235f38
767+
julia> floatmin(Float32) # smallest positive finite Float32 floating point number
768+
1.1754944f-38
769+
770+
julia> nextfloat(-Inf32) == -floatmax(Float32) # equivalent ways of getting the lowest finite Float32 floating point number
771+
true
769772
```
770773
"""
771774
function typemin end
@@ -775,7 +778,7 @@ function typemin end
775778
776779
The highest value representable by the given (real) numeric `DataType`.
777780
778-
See also: [`floatmax`](@ref), [`typemin`](@ref), [`eps`](@ref).
781+
See also: [`floatmax`](@ref), [`maxintfloat`](@ref), [`typemin`](@ref), [`eps`](@ref).
779782
780783
# Examples
781784
```jldoctest
@@ -791,7 +794,7 @@ Inf
791794
julia> typemax(Float32)
792795
Inf32
793796
794-
julia> floatmax(Float32) # largest finite Float32 floating point number
797+
julia> floatmax(Float32) # largest positive finite Float32 floating point number
795798
3.4028235f38
796799
```
797800
"""

0 commit comments

Comments
 (0)