Skip to content

Commit 659bc12

Browse files
add inttype, floattype like uinttype (JuliaLang#36526)
1 parent c1b2fe2 commit 659bc12

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

base/float.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,17 @@ bswap(x::IEEEFloat) = bswap_int(x)
962962
uinttype(::Type{Float64}) = UInt64
963963
uinttype(::Type{Float32}) = UInt32
964964
uinttype(::Type{Float16}) = UInt16
965+
inttype(::Type{Float64}) = Int64
966+
inttype(::Type{Float32}) = Int32
967+
inttype(::Type{Float16}) = Int16
968+
# float size of integer
969+
floattype(::Type{UInt64}) = Float64
970+
floattype(::Type{UInt32}) = Float32
971+
floattype(::Type{UInt16}) = Float16
972+
floattype(::Type{Int64}) = Float64
973+
floattype(::Type{Int32}) = Float32
974+
floattype(::Type{Int16}) = Float16
975+
965976

966977
## Array operations on floating point numbers ##
967978

0 commit comments

Comments
 (0)