Skip to content

Commit

Permalink
Merge pull request #7 from JuliaMath/teh/integer
Browse files Browse the repository at this point in the history
Support `convert(RInteger, x)`
  • Loading branch information
timholy authored Sep 11, 2017
2 parents d7f39fe + 09bb214 commit 9f2fcc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/RoundingIntegers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ else
const RUInt = RUInt64
end

itype(::Type{RInteger}) = Integer
itype(::Type{RSigned}) = Signed
itype(::Type{RUnsigned}) = Unsigned
itype(::Type{RInt8}) = Int8
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ end
@test x === 5
@test isa(convert(RUInt8, 2), RUInt8)
@test -7 % RUInt8 === RUInt8(0xf9)
@test convert(RInteger, 3) === RInt(3)
@test convert(RInteger, 0x03) === RUInt8(3)

@test typemin(RInt16) === RInt16(typemin(Int16))
@test typemin(RInt32) === RInt32(typemin(Int32))
Expand Down

0 comments on commit 9f2fcc6

Please sign in to comment.