From 5a66c6960a3e72bfc91937955394791a5c4bf7e6 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 16 Aug 2018 18:01:11 -0400 Subject: [PATCH] realmin/realmax are now floatmin/floatmax (#607) --- README.md | 3 +++ src/Compat.jl | 7 +++++++ test/runtests.jl | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index e8bc94440..dee2ddb74 100644 --- a/README.md +++ b/README.md @@ -432,6 +432,8 @@ Currently, the `@compat` macro supports the following syntaxes: * `atan2` is now a 2-argument method of `atan` ([#27253]). +* `realmin` and `realmax` are now `floatmin` and `floatmax` ([#28302]) + ## New macros * `@__DIR__` has been added ([#18380]) @@ -668,3 +670,4 @@ includes this fix. Find the minimum version from there. [#27711]: https://github.com/JuliaLang/julia/issues/27711 [#27828]: https://github.com/JuliaLang/julia/issues/27828 [#27834]: https://github.com/JuliaLang/julia/issues/27834 +[#28302]: https://github.com/JuliaLang/julia/issues/28302 diff --git a/src/Compat.jl b/src/Compat.jl index 54adc0724..df78f0aa3 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -2004,6 +2004,13 @@ if VERSION < v"0.7.0-beta.73" mapslices(f, A, dims) end +# https://github.com/JuliaLang/julia/pull/28302 +if VERSION < v"0.7.0-beta2.169" + const floatmin = realmin + const floatmax = realmax + export floatmin, floatmax +end + include("deprecated.jl") end # module Compat diff --git a/test/runtests.jl b/test/runtests.jl index 1fde8d6a1..e313ad322 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1930,4 +1930,9 @@ let a = rand(5,5) end end +# 0.7.0-beta2.169 +@test floatmin(Float16) == @eval $(Core.Intrinsics.bitcast(Float16, 0x0400)) +@test floatmax(Float32) == @eval $(Core.Intrinsics.bitcast(Float32, 0x7f7fffff)) +@test floatmin(zero(Float64)) == floatmin(Float64) + nothing