diff --git a/src/RoundingIntegers.jl b/src/RoundingIntegers.jl index 35f1101..148d6b6 100644 --- a/src/RoundingIntegers.jl +++ b/src/RoundingIntegers.jl @@ -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)) diff --git a/test/runtests.jl b/test/runtests.jl index 70e4de0..f995616 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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