Skip to content

Commit

Permalink
Fix and test show. Fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Mar 23, 2017
1 parent 7c0d397 commit a509e2f
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 @@ -135,6 +135,7 @@ Base.flipsign(x::RSigned, y::RSigned) = RInteger(flipsign(Integer(x), Integer(y)
Base.count_ones(x::RInteger) = count_ones(Integer(x))
Base.leading_zeros(x::RInteger) = leading_zeros(Integer(x))
Base.trailing_zeros(x::RInteger) = trailing_zeros(Integer(x))
Base.ndigits0z(x::RInteger) = Base.ndigits0z(Integer(x))

# A few operations preserve the type
-(x::RInteger) = RInteger(-Integer(x))
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ end
@test copysign(r, r) === r
@test unsigned(r) === RUInt(5)
@test hex(r) == "5"

@test string(RInt(7.2)) == "7"
end

@testset "Rounding" begin
Expand Down

0 comments on commit a509e2f

Please sign in to comment.