from typing import BinaryIO
from typing import cast
import struct


def read_float(stream: BinaryIO) -> float:
    """Read a float value in big-endian order."""
    return cast(float, struct.unpack('>f', stream.read(4))[0])