Skip to content

Commit

Permalink
binary16: remove sign bit from mantissa
Browse files Browse the repository at this point in the history
  • Loading branch information
mewmew committed Jul 7, 2018
1 parent 78b66f4 commit 3048931
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions binary16/binary16.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ func NewFromBig(x *big.Float) (f Float, exact bool) {
fmt.Printf("bits: %04X\n", bits)

fmt.Println("mant:", mant)
if mant.Signbit() {
mant.Neg(mant)
}
mant.SetMantExp(mant, precision)
fmt.Println("mant:", mant)
if !mant.IsInt() {
Expand Down

0 comments on commit 3048931

Please sign in to comment.