elm install elm-toulouse/float16
import Bytes exposing (Bytes, Endianness(..))
import Bytes.Decode as D
import Bytes.Encode as E
import Bytes.Floating.Encode as E
-- ENCODER
encode : Float -> E.Encoder
encode f =
E.sequence
[ E.float16 BE f
, E.float32 BE f
, E.float64 BE f
]
-- DECODER
decode : D.Decoder (Float, Float, Float)
decode =
D.map3 (\a b c -> (a, b, c))
|> D.float16 BE
|> D.float32 BE
|> D.float64 BE