BitwiseComplementTest
`Bitwise.complement` flips every bit, so the complement of `n` is `-n - 1`.
Results
elm-0.19.1
passran in 45 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. comp1: -1 comp2: -16
elm-0.19.2
passran in 47 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. comp1: -1 comp2: -16
elm-0.19.3
passran in 65 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. comp1: -1 comp2: -16
lamdera-1.5.0
passran in 63 msOutput
comp1: -1 comp2: -16
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/BitwiseComplementTest] in its title.
Source
The -- CHECK: lines give the expected output.
module BitwiseComplementTest exposing (main)
{-| `Bitwise.complement` flips every bit, so the complement of `n` is `-n - 1`.
-}
-- CHECK: comp1: -1
-- CHECK: comp2: -16
import Bitwise
import Html exposing (text)
main =
let
_ = Debug.log "comp1" (Bitwise.complement 0)
_ = Debug.log "comp2" (Bitwise.complement 15)
in
text "done"