Skip to content

Commit 60edea9

Browse files
authored
Update README.md
Add the method: (f Float16) Bits() uint16. It's the reverse of Frombits() function.
1 parent b81f78f commit 60edea9

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,14 @@ package float16 // import "github.com/cbor-go/float16"
7070
type Float16 uint16
7171
7272
// Exported functions
73-
Fromfloat32(f32 float32) Float16 // Float16 converted from f32 using IEEE 754 default rounding
74-
Frombits(u16 uint16) Float16 // Float16 by casting uint16 to Float16
75-
NaN() Float16 // IEEE 754 half-precision not-a-number
76-
Inf(sign int) Float16 // IEEE 754 half-precision infinity according to sign
73+
Fromfloat32(f32 float32) Float16 // Float16 number converted from f32 using IEEE 754 default rounding
74+
Frombits(b16 uint16) Float16 // Float16 number corresponding to b16 (IEEE 754 binary16 rep.)
75+
NaN() Float16 // Float16 of IEEE 754 binary16 not-a-number
76+
Inf(sign int) Float16 // Float16 of IEEE 754 binary16 infinity according to sign
7777
7878
// Exported methods
79-
(f Float16) Float32() float32 // float32 converted from f16 using lossless conversion
79+
(f Float16) Float32() float32 // float32 number converted from f16 using lossless conversion
80+
(f Float16) Bits() uint16 // the IEEE 754 binary16 representation of f
8081
(f Float16) IsNaN() bool // true if f is not-a-number (NaN)
8182
(f Float16) IsInf(sign int) bool // true if f is infinite based on sign (-1=NegInf, 0=any, 1=PosInf)
8283
(f Float16) IsFinite() bool // true if f is not infinite or NaN

0 commit comments

Comments
 (0)