EncodeFloat64BETest
`Bytes.Encode.float64` with big-endian order writes 8 bytes. The test encodes `3.141592653589793` and logs the width of the result.
Results
elm-0.19.1
passran in 55 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. EncodeFloat64BETest: 8
elm-0.19.2
passran in 48 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. EncodeFloat64BETest: 8
elm-0.19.3
passran in 57 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. EncodeFloat64BETest: 8
lamdera-1.5.0
passran in 71 msOutput
EncodeFloat64BETest: 8
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-bytes/EncodeFloat64BETest] in its title.
Source
The -- CHECK: lines give the expected output.
module EncodeFloat64BETest exposing (main)
{-| `Bytes.Encode.float64` with big-endian order writes 8 bytes.
The test encodes `3.141592653589793` and logs the width of the result.
-}
-- CHECK: EncodeFloat64BETest: 8
import Bytes exposing (Bytes, Endianness(..))
import Bytes.Encode as E
import Html exposing (text)
main =
let
bytes =
E.encode (E.float64 BE 3.141592653589793)
result =
Bytes.width bytes
_ =
Debug.log "EncodeFloat64BETest" result
in
text (String.fromInt result)