mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-08 11:56:46 +01:00
Add Float40 methods
This commit adds Float40 related methods, and keeps the Float16 version which will be deleted in a near future once the Float40 migration is ready.
This commit is contained in:
@@ -30,6 +30,7 @@ func (f16 Float16) Bytes() []byte {
|
||||
|
||||
// Float16FromBytes returns a Float16 from a byte array of 2 bytes.
|
||||
func Float16FromBytes(b []byte) *Float16 {
|
||||
// WARNING b[:2] for a b where len(b)<2 can break
|
||||
f16 := Float16(binary.BigEndian.Uint16(b[:2]))
|
||||
return &f16
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user