Fix read_float* functions
This commit is contained in:
parent
69a1afa2bc
commit
9d1f601ee9
@ -333,7 +333,7 @@ def read_float32(stream: io.BufferedIOBase) -> float:
|
|||||||
:return: The value read.
|
:return: The value read.
|
||||||
"""
|
"""
|
||||||
b = _read(stream, 4)
|
b = _read(stream, 4)
|
||||||
return struct.unpack("<f", b)
|
return struct.unpack("<f", b)[0]
|
||||||
|
|
||||||
|
|
||||||
def write_float32(stream: io.BufferedIOBase, f: float) -> int:
|
def write_float32(stream: io.BufferedIOBase, f: float) -> int:
|
||||||
@ -356,7 +356,7 @@ def read_float64(stream: io.BufferedIOBase) -> float:
|
|||||||
:return: The value read.
|
:return: The value read.
|
||||||
"""
|
"""
|
||||||
b = _read(stream, 8)
|
b = _read(stream, 8)
|
||||||
return struct.unpack("<d", b)
|
return struct.unpack("<d", b)[0]
|
||||||
|
|
||||||
|
|
||||||
def write_float64(stream: io.BufferedIOBase, f: float) -> int:
|
def write_float64(stream: io.BufferedIOBase, f: float) -> int:
|
||||||
|
Loading…
Reference in New Issue
Block a user