milankl/SoftPosit.jl

Posit32(true) fails

chrisvwx opened this issue · 1 comments

Using Matrix to make a dense matrix out of the Q output of the qr function wants Posit32(true) to work:

julia> using SoftPosit
julia> Qt,R = qr(Posit32.(randn(3,3)));
julia> Q = Matrix(Qt)

You're welcome to ignore this.

So what's actually needed is Posit(x::Bool) = if x one(Posit) else zero(Posit) end as well as promotion from true to one(Posit) and false to zero(Posit). I don't see a reason not to do this. I'll implement it.