Skip to content

Commit

Permalink
realmin/realmax are now floatmin/floatmax (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmcreynolds authored and ararslan committed Aug 16, 2018
1 parent cec0d8b commit 5a66c69
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5a66c69

Please sign in to comment.