Skip to content

Commit

Permalink
Merge 0a63a74 into 92f8c17
Browse files Browse the repository at this point in the history
  • Loading branch information
dphildebrandt committed Jun 24, 2015
2 parents 92f8c17 + 0a63a74 commit b6f87af
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions base/float.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ const Inf16 = box(Float16,unbox(UInt16,0x7c00))
const NaN16 = box(Float16,unbox(UInt16,0x7e00))
const Inf32 = box(Float32,unbox(UInt32,0x7f800000))
const NaN32 = box(Float32,unbox(UInt32,0x7fc00000))
const Inf = box(Float64,unbox(UInt64,0x7ff0000000000000))
const NaN = box(Float64,unbox(UInt64,0x7ff8000000000000))
const Inf64 = box(Float64,unbox(UInt64,0x7ff0000000000000))
const NaN64 = box(Float64,unbox(UInt64,0x7ff8000000000000))

if is(Int,Int64)
const Inf = Inf64
const NaN = NaN64
else
const Inf = Inf32
const NaN = NaN32
end

## conversions to floating-point ##
convert(::Type{Float16}, x::Integer) = convert(Float16, convert(Float32,x))
Expand Down Expand Up @@ -374,8 +382,8 @@ end
typemax(::Type{Float16}) = $(Inf16)
typemin(::Type{Float32}) = $(-Inf32)
typemax(::Type{Float32}) = $(Inf32)
typemin(::Type{Float64}) = $(-Inf)
typemax(::Type{Float64}) = $(Inf)
typemin(::Type{Float64}) = $(-Inf64)
typemax(::Type{Float64}) = $(Inf64)
typemin{T<:Real}(x::T) = typemin(T)
typemax{T<:Real}(x::T) = typemax(T)

Expand Down

0 comments on commit b6f87af

Please sign in to comment.