BitwiseShiftLeftTest
`Bitwise.shiftLeftBy n x` shifts the bits of `x` left by `n` places, multiplying it by 2 to the power `n`.
Results
elm-0.19.1
passran in 44 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. shl1: 16 shl2: 32 shl3: 1024
elm-0.19.2
passran in 44 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. shl1: 16 shl2: 32 shl3: 1024
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. shl1: 16 shl2: 32 shl3: 1024
lamdera-1.5.0
passran in 55 msOutput
shl1: 16 shl2: 32 shl3: 1024
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/BitwiseShiftLeftTest] in its title.
Source
The -- CHECK: lines give the expected output.
module BitwiseShiftLeftTest exposing (main)
{-| `Bitwise.shiftLeftBy n x` shifts the bits of `x` left by `n` places, multiplying it by 2 to the power `n`.
-}
-- CHECK: shl1: 16
-- CHECK: shl2: 32
-- CHECK: shl3: 1024
import Bitwise
import Html exposing (text)
main =
let
_ = Debug.log "shl1" (Bitwise.shiftLeftBy 4 1)
_ = Debug.log "shl2" (Bitwise.shiftLeftBy 1 16)
_ = Debug.log "shl3" (Bitwise.shiftLeftBy 10 1)
in
text "done"