Skip to content

Commit

Permalink
Add unsigned(T) in addition to existing unsigned(x::XBS).
Browse files Browse the repository at this point in the history
  • Loading branch information
NHDaly committed Dec 12, 2018
1 parent 219681e commit 9b4b9b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BitIntegers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ typemax(::Type{T}) where {T<:XBS} = bitcast(T, typemax(uinttype(T)) >> 1)

# ** unsigned

unsigned(x::XBS) = reinterpret(typeof(convert(Unsigned, zero(x))), x)
unsigned(::Type{T}) where T<:XBS = typeof(convert(Unsigned, zero(T)))
unsigned(x::T) where T<:XBS = reinterpret(unsigned(T), x)

# ** integers

Expand Down

0 comments on commit 9b4b9b5

Please sign in to comment.