-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making typemin and typemax give Infs on Floats
adding isdenormal() using contains() instead of has(String, Char), part of issue #50
- Loading branch information
1 parent
e055905
commit 27c84fe
Showing
5 changed files
with
40 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,10 +118,13 @@ NaN = boxf64(unbox64(0x7ff8000000000000)) | |
inf{T<:Float}(x::T) = inf(T) | ||
nan{T<:Float}(x::T) = nan(T) | ||
|
||
typemin(::Type{Float32}) = $boxf32(unbox32(uint32(0x00800000))) | ||
typemax(::Type{Float32}) = $boxf32(unbox32(uint32(0x7f7fffff))) | ||
typemin(::Type{Float64}) = $boxf64(unbox64(0x0010000000000000)) | ||
typemax(::Type{Float64}) = $boxf64(unbox64(0x7fefffffffffffff)) | ||
isdenormal(x::Float32) = (abs(x) < $boxf32(unbox32(uint32(0x00800000)))) | ||
isdenormal(x::Float64) = (abs(x) < $boxf64(unbox64(0x0010000000000000))) | ||
|
||
typemin(::Type{Float32}) = $(-float32(Inf)) | ||
typemax(::Type{Float32}) = $(float32(Inf)) | ||
typemin(::Type{Float64}) = $(-Inf) | ||
typemax(::Type{Float64}) = Inf | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JeffBezanson
Author
Member
|
||
|
||
eps(::Type{Float32}) = $boxf32(unbox32(uint32(0x34000000))) | ||
eps(::Type{Float64}) = $boxf64(unbox64(0x3cb0000000000000)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shouldn't this be
typemax(::Type{Float64}) = $(Inf)
so that the global lookup doesn't happen on every call?