From 8fc771674c893e072e6b365898689c9301202688 Mon Sep 17 00:00:00 2001
From: "femtocleaner[bot]" <femtocleaner[bot]@users.noreply.github.com>
Date: Sat, 28 Jul 2018 12:38:49 -0400
Subject: [PATCH 1/2] Rename realmin/max -> floatmin/max

---
 base/complex.jl                    |  8 +++----
 base/exports.jl                    |  4 ++--
 base/float.jl                      | 28 ++++++++++++------------
 base/mpfr.jl                       |  6 +++---
 base/special/cbrt.jl               |  2 +-
 base/twiceprecision.jl             |  2 +-
 stdlib/LinearAlgebra/src/givens.jl |  4 ++--
 stdlib/LinearAlgebra/test/pinv.jl  | 12 +++++------
 stdlib/Statistics/test/runtests.jl |  2 +-
 test/grisu.jl                      |  4 ++--
 test/math.jl                       | 34 +++++++++++++++---------------
 test/mpfr.jl                       |  8 +++----
 test/numbers.jl                    | 16 +++++++-------
 test/ranges.jl                     |  8 +++----
 test/rational.jl                   | 16 +++++++-------
 15 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/base/complex.jl b/base/complex.jl
index d074e13bcbd12..dc736ebb8e797 100644
--- a/base/complex.jl
+++ b/base/complex.jl
@@ -364,8 +364,8 @@ function /(z::ComplexF64, w::ComplexF64)
     two = 2.0
     ab = max(abs(a), abs(b))
     cd = max(abs(c), abs(d))
-    ov = realmax(a)
-    un = realmin(a)
+    ov = floatmax(a)
+    un = floatmin(a)
     ϵ = eps(Float64)
     bs = two/(ϵ*ϵ)
     s = 1.0
@@ -397,8 +397,8 @@ function inv(w::ComplexF64)
     half = 0.5
     two = 2.0
     cd = max(abs(c), abs(d))
-    ov = realmax(c)
-    un = realmin(c)
+    ov = floatmax(c)
+    un = floatmin(c)
     ϵ = eps(Float64)
     bs = two/(ϵ*ϵ)
     s = 1.0
diff --git a/base/exports.jl b/base/exports.jl
index 156502365211e..97553a8773334 100644
--- a/base/exports.jl
+++ b/base/exports.jl
@@ -309,8 +309,8 @@ export
     rad2deg,
     rationalize,
     real,
-    realmax,
-    realmin,
+    floatmax,
+    floatmin,
     reim,
     reinterpret,
     rem,
diff --git a/base/float.jl b/base/float.jl
index 83c388b2633cf..6d3b7873984ea 100644
--- a/base/float.jl
+++ b/base/float.jl
@@ -725,14 +725,14 @@ end
     typemin(x::T) where {T<:Real} = typemin(T)
     typemax(x::T) where {T<:Real} = typemax(T)
 
-    realmin(::Type{Float16}) = $(bitcast(Float16, 0x0400))
-    realmin(::Type{Float32}) = $(bitcast(Float32, 0x00800000))
-    realmin(::Type{Float64}) = $(bitcast(Float64, 0x0010000000000000))
-    realmax(::Type{Float16}) = $(bitcast(Float16, 0x7bff))
-    realmax(::Type{Float32}) = $(bitcast(Float32, 0x7f7fffff))
-    realmax(::Type{Float64}) = $(bitcast(Float64, 0x7fefffffffffffff))
-
-    eps(x::AbstractFloat) = isfinite(x) ? abs(x) >= realmin(x) ? ldexp(eps(typeof(x)), exponent(x)) : nextfloat(zero(x)) : oftype(x, NaN)
+    floatmin(::Type{Float16}) = $(bitcast(Float16, 0x0400))
+    floatmin(::Type{Float32}) = $(bitcast(Float32, 0x00800000))
+    floatmin(::Type{Float64}) = $(bitcast(Float64, 0x0010000000000000))
+    floatmax(::Type{Float16}) = $(bitcast(Float16, 0x7bff))
+    floatmax(::Type{Float32}) = $(bitcast(Float32, 0x7f7fffff))
+    floatmax(::Type{Float64}) = $(bitcast(Float64, 0x7fefffffffffffff))
+
+    eps(x::AbstractFloat) = isfinite(x) ? abs(x) >= floatmin(x) ? ldexp(eps(typeof(x)), exponent(x)) : nextfloat(zero(x)) : oftype(x, NaN)
     eps(::Type{Float16}) = $(bitcast(Float16, 0x1400))
     eps(::Type{Float32}) = $(bitcast(Float32, 0x34000000))
     eps(::Type{Float64}) = $(bitcast(Float64, 0x3cb0000000000000))
@@ -745,7 +745,7 @@ end
 The smallest in absolute value non-subnormal value representable by the given
 floating-point DataType `T`.
 """
-realmin(x::T) where {T<:AbstractFloat} = realmin(T)
+floatmin(x::T) where {T<:AbstractFloat} = floatmin(T)
 
 """
     realmax(T)
@@ -754,17 +754,17 @@ The highest finite value representable by the given floating-point DataType `T`.
 
 # Examples
 ```jldoctest
-julia> realmax(Float16)
+julia> floatmax(Float16)
 Float16(6.55e4)
 
-julia> realmax(Float32)
+julia> floatmax(Float32)
 3.4028235f38
 ```
 """
-realmax(x::T) where {T<:AbstractFloat} = realmax(T)
+floatmax(x::T) where {T<:AbstractFloat} = floatmax(T)
 
-realmin() = realmin(Float64)
-realmax() = realmax(Float64)
+floatmin() = floatmin(Float64)
+floatmax() = floatmax(Float64)
 
 """
     eps(::Type{T}) where T<:AbstractFloat
diff --git a/base/mpfr.jl b/base/mpfr.jl
index ef149e7f8bfcf..c5ddf334709bc 100644
--- a/base/mpfr.jl
+++ b/base/mpfr.jl
@@ -15,7 +15,7 @@ import
         log1p,
         eps, signbit, sin, cos, sincos, tan, sec, csc, cot, acos, asin, atan,
         cosh, sinh, tanh, sech, csch, coth, acosh, asinh, atanh,
-        cbrt, typemax, typemin, unsafe_trunc, realmin, realmax, rounding,
+        cbrt, typemax, typemin, unsafe_trunc, floatmin, floatmax, rounding,
         setrounding, maxintfloat, widen, significand, frexp, tryparse, iszero,
         isone, big, _string_n
 
@@ -881,8 +881,8 @@ end
 
 eps(::Type{BigFloat}) = nextfloat(BigFloat(1)) - BigFloat(1)
 
-realmin(::Type{BigFloat}) = nextfloat(zero(BigFloat))
-realmax(::Type{BigFloat}) = prevfloat(BigFloat(Inf))
+floatmin(::Type{BigFloat}) = nextfloat(zero(BigFloat))
+floatmax(::Type{BigFloat}) = prevfloat(BigFloat(Inf))
 
 """
     setprecision(f::Function, [T=BigFloat,] precision::Integer)
diff --git a/base/special/cbrt.jl b/base/special/cbrt.jl
index 900cbcc5683d6..e902cf0bde7c3 100644
--- a/base/special/cbrt.jl
+++ b/base/special/cbrt.jl
@@ -65,7 +65,7 @@ These implementations assume that NaNs, infinities and zeros have already been f
     k = significand_bits(T) - (8*sizeof(T) - 32)
 
     u = highword(x) & 0x7fff_ffff
-    if u >= Base.Math.highword(realmin(T))
+    if u >= Base.Math.highword(floatmin(T))
         v = div(u, UInt32(3)) + floor(UInt32, adj * exp2(k))
     else
         # subnormal
diff --git a/base/twiceprecision.jl b/base/twiceprecision.jl
index dded192d85144..cf61823ecc0f6 100644
--- a/base/twiceprecision.jl
+++ b/base/twiceprecision.jl
@@ -622,7 +622,7 @@ function _linspace(start::T, stop::T, len::Integer) where {T<:IEEEFloat}
     end
     # 2x calculations to get high precision endpoint matching while also
     # preventing overflow in ref_hi+(i-offset)*step_hi
-    m, k = prevfloat(realmax(T)), max(imin-1, len-imin)
+    m, k = prevfloat(floatmax(T)), max(imin-1, len-imin)
     step_hi_pre = clamp(step, max(-(m+ref)/k, (-m+ref)/k), min((m-ref)/k, (m+ref)/k))
     nb = nbitslen(T, len, imin)
     step_hi = truncbits(step_hi_pre, nb)
diff --git a/stdlib/LinearAlgebra/src/givens.jl b/stdlib/LinearAlgebra/src/givens.jl
index 9113c2e2e1949..834dc4e1fe7fe 100644
--- a/stdlib/LinearAlgebra/src/givens.jl
+++ b/stdlib/LinearAlgebra/src/givens.jl
@@ -63,7 +63,7 @@ Base.copy(aR::Adjoint{<:Any,Rotation{T}}) where {T} = Rotation{T}(reverse!([r' f
 
 realmin2(::Type{Float32}) = reinterpret(Float32, 0x26000000)
 realmin2(::Type{Float64}) = reinterpret(Float64, 0x21a0000000000000)
-realmin2(::Type{T}) where {T} = (twopar = 2one(T); twopar^trunc(Integer,log(realmin(T)/eps(T))/log(twopar)/twopar))
+realmin2(::Type{T}) where {T} = (twopar = 2one(T); twopar^trunc(Integer,log(floatmin(T)/eps(T))/log(twopar)/twopar))
 
 # derived from LAPACK's dlartg
 # Copyright:
@@ -152,7 +152,7 @@ function givensAlgorithm(f::Complex{T}, g::Complex{T}) where T<:AbstractFloat
     czero = complex(zeropar)
 
     abs1(ff) = max(abs(real(ff)), abs(imag(ff)))
-    safmin = realmin(T0)
+    safmin = floatmin(T0)
     safmn2 = realmin2(T0)
     safmn2u = realmin2(T)
     safmx2 = one(T)/safmn2
diff --git a/stdlib/LinearAlgebra/test/pinv.jl b/stdlib/LinearAlgebra/test/pinv.jl
index 489f7c0c8e421..e0253da4a51c8 100644
--- a/stdlib/LinearAlgebra/test/pinv.jl
+++ b/stdlib/LinearAlgebra/test/pinv.jl
@@ -160,24 +160,24 @@ end
 
     if eltya <: LinearAlgebra.BlasReal
         @testset "sub-normal numbers/vectors/matrices" begin
-            a = pinv(realmin(eltya)/100)
+            a = pinv(floatmin(eltya)/100)
             @test a ≈ 0.0
             # Complex subnormal
-            a = pinv(realmin(eltya)/100*(1+1im))
+            a = pinv(floatmin(eltya)/100*(1+1im))
             @test a ≈ 0.0
 
-            a = pinv([realmin(eltya); realmin(eltya)]/100)
+            a = pinv([floatmin(eltya); floatmin(eltya)]/100)
             @test a[1] ≈ 0.0
             @test a[2] ≈ 0.0
             # Complex subnormal
-            a = pinv([realmin(eltya); realmin(eltya)]/100*(1+1im))
+            a = pinv([floatmin(eltya); floatmin(eltya)]/100*(1+1im))
             @test a[1] ≈ 0.0
             @test a[2] ≈ 0.0
-            a = pinv(Diagonal([realmin(eltya); realmin(eltya)]/100))
+            a = pinv(Diagonal([floatmin(eltya); floatmin(eltya)]/100))
             @test a.diag[1] ≈ 0.0
             @test a.diag[2] ≈ 0.0
             # Complex subnormal
-            a = pinv(Diagonal([realmin(eltya); realmin(eltya)]/100*(1+1im)))
+            a = pinv(Diagonal([floatmin(eltya); floatmin(eltya)]/100*(1+1im)))
             @test a.diag[1] ≈ 0.0
             @test a.diag[2] ≈ 0.0
         end
diff --git a/stdlib/Statistics/test/runtests.jl b/stdlib/Statistics/test/runtests.jl
index 7733e9ae6166a..3ec105eb98719 100644
--- a/stdlib/Statistics/test/runtests.jl
+++ b/stdlib/Statistics/test/runtests.jl
@@ -6,7 +6,7 @@ using Test: guardsrand
 @testset "middle" begin
     @test middle(3) === 3.0
     @test middle(2, 3) === 2.5
-    let x = ((realmax(1.0)/4)*3)
+    let x = ((floatmax(1.0)/4)*3)
         @test middle(x, x) === x
     end
     @test middle(1:8) === 4.5
diff --git a/test/grisu.jl b/test/grisu.jl
index f11d694225824..8cac9b223b9ba 100644
--- a/test/grisu.jl
+++ b/test/grisu.jl
@@ -1278,14 +1278,14 @@ fill!(buffer,0)
 map(x->Grisu.Bignums.zero!(x),bignums)
 
 #Float16
-min_double = realmin(Float16)
+min_double = floatmin(Float16)
 status,len,point = Grisu.fastshortest(min_double,buffer)
 @test status
 @test "6104" == trimrep(buffer)
 @test -4 == point
 fill!(buffer,0)
 
-max_double = realmax(Float16)
+max_double = floatmax(Float16)
 status,len,point = Grisu.fastshortest(max_double,buffer)
 @test status
 @test "655" == trimrep(buffer)
diff --git a/test/math.jl b/test/math.jl
index d0fd491d81427..85b81b6f17e84 100644
--- a/test/math.jl
+++ b/test/math.jl
@@ -56,9 +56,9 @@ end
         end
 
         for (a,b) in [(T(12.8),T(0.8)),
-                      (prevfloat(realmin(T)), prevfloat(one(T), 2)),
-                      (prevfloat(realmin(T)), prevfloat(one(T), 2)),
-                      (prevfloat(realmin(T)), nextfloat(one(T), -2)),
+                      (prevfloat(floatmin(T)), prevfloat(one(T), 2)),
+                      (prevfloat(floatmin(T)), prevfloat(one(T), 2)),
+                      (prevfloat(floatmin(T)), nextfloat(one(T), -2)),
                       (nextfloat(zero(T), 3), T(0.75)),
                       (prevfloat(zero(T), -3), T(0.75)),
                       (nextfloat(zero(T)), T(0.5))]
@@ -94,8 +94,8 @@ end
             @test ldexp(T(-0.854375), 5) === T(-27.34)
             @test ldexp(T(1.0), typemax(Int)) === T(Inf)
             @test ldexp(T(1.0), typemin(Int)) === T(0.0)
-            @test ldexp(prevfloat(realmin(T)), typemax(Int)) === T(Inf)
-            @test ldexp(prevfloat(realmin(T)), typemin(Int)) === T(0.0)
+            @test ldexp(prevfloat(floatmin(T)), typemax(Int)) === T(Inf)
+            @test ldexp(prevfloat(floatmin(T)), typemin(Int)) === T(0.0)
 
             @test ldexp(T(0.0), Int128(0)) === T(0.0)
             @test ldexp(T(-0.0), Int128(0)) === T(-0.0)
@@ -104,8 +104,8 @@ end
             @test ldexp(T(-0.854375), Int128(5)) === T(-27.34)
             @test ldexp(T(1.0), typemax(Int128)) === T(Inf)
             @test ldexp(T(1.0), typemin(Int128)) === T(0.0)
-            @test ldexp(prevfloat(realmin(T)), typemax(Int128)) === T(Inf)
-            @test ldexp(prevfloat(realmin(T)), typemin(Int128)) === T(0.0)
+            @test ldexp(prevfloat(floatmin(T)), typemax(Int128)) === T(Inf)
+            @test ldexp(prevfloat(floatmin(T)), typemin(Int128)) === T(0.0)
 
             @test ldexp(T(0.0), BigInt(0)) === T(0.0)
             @test ldexp(T(-0.0), BigInt(0)) === T(-0.0)
@@ -114,18 +114,18 @@ end
             @test ldexp(T(-0.854375), BigInt(5)) === T(-27.34)
             @test ldexp(T(1.0), BigInt(typemax(Int128))) === T(Inf)
             @test ldexp(T(1.0), BigInt(typemin(Int128))) === T(0.0)
-            @test ldexp(prevfloat(realmin(T)), BigInt(typemax(Int128))) === T(Inf)
-            @test ldexp(prevfloat(realmin(T)), BigInt(typemin(Int128))) === T(0.0)
+            @test ldexp(prevfloat(floatmin(T)), BigInt(typemax(Int128))) === T(Inf)
+            @test ldexp(prevfloat(floatmin(T)), BigInt(typemin(Int128))) === T(0.0)
 
             # Test also against BigFloat reference. Needs to be exactly rounded.
-            @test ldexp(realmin(T), -1) == T(ldexp(big(realmin(T)), -1))
-            @test ldexp(realmin(T), -2) == T(ldexp(big(realmin(T)), -2))
-            @test ldexp(realmin(T)/2, 0) == T(ldexp(big(realmin(T)/2), 0))
-            @test ldexp(realmin(T)/3, 0) == T(ldexp(big(realmin(T)/3), 0))
-            @test ldexp(realmin(T)/3, -1) == T(ldexp(big(realmin(T)/3), -1))
-            @test ldexp(realmin(T)/3, 11) == T(ldexp(big(realmin(T)/3), 11))
-            @test ldexp(realmin(T)/11, -10) == T(ldexp(big(realmin(T)/11), -10))
-            @test ldexp(-realmin(T)/11, -10) == T(ldexp(big(-realmin(T)/11), -10))
+            @test ldexp(floatmin(T), -1) == T(ldexp(big(floatmin(T)), -1))
+            @test ldexp(floatmin(T), -2) == T(ldexp(big(floatmin(T)), -2))
+            @test ldexp(floatmin(T)/2, 0) == T(ldexp(big(floatmin(T)/2), 0))
+            @test ldexp(floatmin(T)/3, 0) == T(ldexp(big(floatmin(T)/3), 0))
+            @test ldexp(floatmin(T)/3, -1) == T(ldexp(big(floatmin(T)/3), -1))
+            @test ldexp(floatmin(T)/3, 11) == T(ldexp(big(floatmin(T)/3), 11))
+            @test ldexp(floatmin(T)/11, -10) == T(ldexp(big(floatmin(T)/11), -10))
+            @test ldexp(-floatmin(T)/11, -10) == T(ldexp(big(-floatmin(T)/11), -10))
         end
     end
 end
diff --git a/test/mpfr.jl b/test/mpfr.jl
index 1011b4522a6ec..86edcf34cb05f 100644
--- a/test/mpfr.jl
+++ b/test/mpfr.jl
@@ -27,8 +27,8 @@ import Base.MPFR
     @test typeof(BigFloat(typemax(UInt64))) == BigFloat
     @test typeof(BigFloat(typemax(UInt128))) == BigFloat
 
-    @test typeof(BigFloat(realmax(Float32))) == BigFloat
-    @test typeof(BigFloat(realmax(Float64))) == BigFloat
+    @test typeof(BigFloat(floatmax(Float32))) == BigFloat
+    @test typeof(BigFloat(floatmax(Float64))) == BigFloat
 
     @test typeof(BigFloat(BigInt(1))) == BigFloat
     @test typeof(BigFloat(BigFloat(1))) == BigFloat
@@ -649,10 +649,10 @@ end
     @test eps(BigFloat) == eps(BigFloat(1))
 end
 @testset "realmin/realmax" begin
-    x = realmin(BigFloat)
+    x = floatmin(BigFloat)
     @test x > 0
     @test prevfloat(x) == 0
-    x = realmax(BigFloat)
+    x = floatmax(BigFloat)
     @test !isinf(x)
     @test isinf(nextfloat(x))
 end
diff --git a/test/numbers.jl b/test/numbers.jl
index 620ef4f09fb0d..b00a983eb8ba3 100644
--- a/test/numbers.jl
+++ b/test/numbers.jl
@@ -1585,10 +1585,10 @@ end
 @test eps(-float(0)) == 5e-324
 @test eps(nextfloat(float(0))) == 5e-324
 @test eps(-nextfloat(float(0))) == 5e-324
-@test eps(realmin()) == 5e-324
-@test eps(-realmin()) == 5e-324
-@test eps(realmax()) ==  2.0^(1023-52)
-@test eps(-realmax()) ==  2.0^(1023-52)
+@test eps(floatmin()) == 5e-324
+@test eps(-floatmin()) == 5e-324
+@test eps(floatmax()) ==  2.0^(1023-52)
+@test eps(-floatmax()) ==  2.0^(1023-52)
 @test isnan(eps(NaN))
 @test isnan(eps(Inf))
 @test isnan(eps(-Inf))
@@ -1786,8 +1786,8 @@ end
     @test 0x1p-52 == eps()
     @test 0x1p-52 + 1 != 1
     @test 0x1p-53 + 1 == 1
-    @test 0x1p-1022 == realmin()
-    @test 0x1.fffffffffffffp1023 == realmax()
+    @test 0x1p-1022 == floatmin()
+    @test 0x1.fffffffffffffp1023 == floatmax()
     @test isinf(nextfloat(0x1.fffffffffffffp1023))
 end
 @testset "issue #1308" begin
@@ -1985,8 +1985,8 @@ for F in (Float16,Float32,Float64)
     @test reinterpret(Signed,one(F)) === signed(Base.exponent_one(F))
 end
 
-@test eps(realmax(Float64)) == 1.99584030953472e292
-@test eps(-realmax(Float64)) == 1.99584030953472e292
+@test eps(floatmax(Float64)) == 1.99584030953472e292
+@test eps(-floatmax(Float64)) == 1.99584030953472e292
 
 # modular multiplicative inverses of odd numbers via exponentiation
 
diff --git a/test/ranges.jl b/test/ranges.jl
index 6dbbce1409828..5817871b04050 100644
--- a/test/ranges.jl
+++ b/test/ranges.jl
@@ -8,7 +8,7 @@ using .Main.PhysQuantities
 # precision compared to widening.
 function cmp_sn(w, hi, lo, slopbits=0)
     if !isfinite(hi)
-        if abs(w) > realmax(typeof(hi))
+        if abs(w) > floatmax(typeof(hi))
             return isinf(hi) && sign(w) == sign(hi)
         end
         if isnan(w) && isnan(hi)
@@ -122,7 +122,7 @@ astuple(x) = (x.hi, x.lo)
 
 function cmp_sn2(w, hi, lo, slopbits=0)
     if !isfinite(hi)
-        if abs(w) > realmax(typeof(hi))
+        if abs(w) > floatmax(typeof(hi))
             return isinf(hi) && sign(w) == sign(hi)
         end
         if isnan(w) && isnan(hi)
@@ -671,11 +671,11 @@ end
 
 @testset "range with very large endpoints for type $T" for T = (Float32, Float64)
     largeint = Int(min(maxintfloat(T), typemax(Int)))
-    a = realmax()
+    a = floatmax()
     for i = 1:5
         @test [range(a, stop=a, length=1);] == [a]
         @test [range(-a, stop=-a, length=1);] == [-a]
-        b = realmax()
+        b = floatmax()
         for j = 1:5
             @test [range(-a, stop=b, length=0);] == []
             @test [range(-a, stop=b, length=2);] == [-a,b]
diff --git a/test/rational.jl b/test/rational.jl
index 506136b5cfc5d..e5296cac2ed17 100644
--- a/test/rational.jl
+++ b/test/rational.jl
@@ -70,12 +70,12 @@ using Test
     @test 0.1 == 3602879701896397//36028797018963968
     @test Inf == 1//0 == 2//0 == typemax(Int)//0
     @test -Inf == -1//0 == -2//0 == -typemax(Int)//0
-    @test realmin() != 1//(BigInt(2)^1022+1)
-    @test realmin() == 1//(BigInt(2)^1022)
-    @test realmin() != 1//(BigInt(2)^1022-1)
-    @test realmin()/2 != 1//(BigInt(2)^1023+1)
-    @test realmin()/2 == 1//(BigInt(2)^1023)
-    @test realmin()/2 != 1//(BigInt(2)^1023-1)
+    @test floatmin() != 1//(BigInt(2)^1022+1)
+    @test floatmin() == 1//(BigInt(2)^1022)
+    @test floatmin() != 1//(BigInt(2)^1022-1)
+    @test floatmin()/2 != 1//(BigInt(2)^1023+1)
+    @test floatmin()/2 == 1//(BigInt(2)^1023)
+    @test floatmin()/2 != 1//(BigInt(2)^1023-1)
     @test nextfloat(0.0) != 1//(BigInt(2)^1074+1)
     @test nextfloat(0.0) == 1//(BigInt(2)^1074)
     @test nextfloat(0.0) != 1//(BigInt(2)^1074-1)
@@ -283,8 +283,8 @@ end
     @test convert(Rational{BigInt},zero(BigFloat)) == 0
     @test convert(Rational{BigInt},-zero(BigFloat)) == 0
     @test convert(Rational{BigInt},5e-324) == 5e-324
-    @test convert(Rational{BigInt},realmin(Float64)) == realmin(Float64)
-    @test convert(Rational{BigInt},realmax(Float64)) == realmax(Float64)
+    @test convert(Rational{BigInt},floatmin(Float64)) == floatmin(Float64)
+    @test convert(Rational{BigInt},floatmax(Float64)) == floatmax(Float64)
 
     @test isa(convert(Float64, big(1)//2), Float64)
 end

From 87bdf3e087b33695a1e6873bdc651fa46e242d6b Mon Sep 17 00:00:00 2001
From: Keno Fischer <keno@alumni.harvard.edu>
Date: Sat, 28 Jul 2018 12:42:32 -0400
Subject: [PATCH 2/2] Manual cleanup

---
 NEWS.md                            |  2 ++
 base/deprecated.jl                 |  4 ++++
 base/float.jl                      |  4 ++--
 doc/src/base/base.md               |  4 ++--
 stdlib/LinearAlgebra/src/givens.jl | 14 +++++++-------
 test/mpfr.jl                       |  2 +-
 test/numbers.jl                    |  2 +-
 7 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 0a5a83ec84fb5..3cde88143e8e2 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1323,6 +1323,8 @@ Deprecated or removed
 
   * `squeeze` is deprecated in favor of `dropdims`.
 
+  * `realmin`/`realmax` are deprecated in favor of `floatmin`/`floatmax` ([#28302]).
+
 Command-line option changes
 ---------------------------
 
diff --git a/base/deprecated.jl b/base/deprecated.jl
index 2907d283cb99a..853eb0bb5b71e 100644
--- a/base/deprecated.jl
+++ b/base/deprecated.jl
@@ -1771,6 +1771,10 @@ end
 # PR #28223
 @deprecate code_llvm_raw(f, types=Tuple) code_llvm(f, types; raw=true)
 
+# PR #28302
+@deprecate realmin floatmin
+@deprecate realmax floatmax
+
 # END 0.7 deprecations
 
 # BEGIN 1.0 deprecations
diff --git a/base/float.jl b/base/float.jl
index 6d3b7873984ea..d4b0b97af19d4 100644
--- a/base/float.jl
+++ b/base/float.jl
@@ -740,7 +740,7 @@ end
 end
 
 """
-    realmin(T)
+    floatmin(T)
 
 The smallest in absolute value non-subnormal value representable by the given
 floating-point DataType `T`.
@@ -748,7 +748,7 @@ floating-point DataType `T`.
 floatmin(x::T) where {T<:AbstractFloat} = floatmin(T)
 
 """
-    realmax(T)
+    floatmax(T)
 
 The highest finite value representable by the given floating-point DataType `T`.
 
diff --git a/doc/src/base/base.md b/doc/src/base/base.md
index 36e47cc53aae2..d2a6dd168c875 100644
--- a/doc/src/base/base.md
+++ b/doc/src/base/base.md
@@ -162,8 +162,8 @@ Base.datatype_pointerfree
 ```@docs
 Base.typemin
 Base.typemax
-Base.realmin
-Base.realmax
+Base.floatmin
+Base.floatmax
 Base.maxintfloat
 Base.eps(::Type{<:AbstractFloat})
 Base.eps(::AbstractFloat)
diff --git a/stdlib/LinearAlgebra/src/givens.jl b/stdlib/LinearAlgebra/src/givens.jl
index 834dc4e1fe7fe..9c5b4bc095083 100644
--- a/stdlib/LinearAlgebra/src/givens.jl
+++ b/stdlib/LinearAlgebra/src/givens.jl
@@ -61,9 +61,9 @@ function Base.copy(aG::Adjoint{<:Any,<:Givens})
 end
 Base.copy(aR::Adjoint{<:Any,Rotation{T}}) where {T} = Rotation{T}(reverse!([r' for r in aR.parent.rotations]))
 
-realmin2(::Type{Float32}) = reinterpret(Float32, 0x26000000)
-realmin2(::Type{Float64}) = reinterpret(Float64, 0x21a0000000000000)
-realmin2(::Type{T}) where {T} = (twopar = 2one(T); twopar^trunc(Integer,log(floatmin(T)/eps(T))/log(twopar)/twopar))
+floatmin2(::Type{Float32}) = reinterpret(Float32, 0x26000000)
+floatmin2(::Type{Float64}) = reinterpret(Float64, 0x21a0000000000000)
+floatmin2(::Type{T}) where {T} = (twopar = 2one(T); twopar^trunc(Integer,log(floatmin(T)/eps(T))/log(twopar)/twopar))
 
 # derived from LAPACK's dlartg
 # Copyright:
@@ -78,8 +78,8 @@ function givensAlgorithm(f::T, g::T) where T<:AbstractFloat
     zeropar = T0(zero(T)) # must be dimensionless
 
     # need both dimensionful and dimensionless versions of these:
-    safmn2 = realmin2(T0)
-    safmn2u = realmin2(T)
+    safmn2 = floatmin2(T0)
+    safmn2u = floatmin2(T)
     safmx2 = one(T)/safmn2
     safmx2u = oneunit(T)/safmn2
 
@@ -153,8 +153,8 @@ function givensAlgorithm(f::Complex{T}, g::Complex{T}) where T<:AbstractFloat
 
     abs1(ff) = max(abs(real(ff)), abs(imag(ff)))
     safmin = floatmin(T0)
-    safmn2 = realmin2(T0)
-    safmn2u = realmin2(T)
+    safmn2 = floatmin2(T0)
+    safmn2u = floatmin2(T)
     safmx2 = one(T)/safmn2
     safmx2u = oneunit(T)/safmn2
     scalepar = max(abs1(f), abs1(g))
diff --git a/test/mpfr.jl b/test/mpfr.jl
index 86edcf34cb05f..878718d7cd3f3 100644
--- a/test/mpfr.jl
+++ b/test/mpfr.jl
@@ -648,7 +648,7 @@ end
     @test BigFloat(1) + x == BigFloat(1) + prevfloat(x)
     @test eps(BigFloat) == eps(BigFloat(1))
 end
-@testset "realmin/realmax" begin
+@testset "floatmin/floatmax" begin
     x = floatmin(BigFloat)
     @test x > 0
     @test prevfloat(x) == 0
diff --git a/test/numbers.jl b/test/numbers.jl
index b00a983eb8ba3..3bed5952746c0 100644
--- a/test/numbers.jl
+++ b/test/numbers.jl
@@ -1782,7 +1782,7 @@ end
     @test 0xf.fP1 === 31.875
     @test -0x1.0p2 === -4.0
 end
-@testset "eps / realmin / realmax" begin
+@testset "eps / floatmin / floatmax" begin
     @test 0x1p-52 == eps()
     @test 0x1p-52 + 1 != 1
     @test 0x1p-53 + 1 == 1