Skip to content

Commit a71f644

Browse files
committed
cbor2: just call unpack with 'e'
1 parent e6b89ea commit a71f644

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python-ecosys/cbor2/cbor2/decoder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ def decode_simple_value(decoder):
159159

160160

161161
def decode_float16(decoder):
162-
payload = decoder.read(2)
163-
raise NotImplementedError # no float16 unpack function
162+
return struct.unpack(">e", decoder.read(2))[0]
164163

165164

166165
def decode_float32(decoder):

0 commit comments

Comments
 (0)