Elm Exactly
Results / elm-core /

CoreIssue1048LogBaseTenTest

Tags:elm19-bug

elm-0.19.1 failelm-0.19.2 failelm-0.19.3 faillamdera-1.5.0 fail

Issue: elm/core#1048

`logBase 10 1000` is exactly 3.

<https://github.com/elm/core/issues/1048>

Elm 0.19.1 computes `log 1000 / log 10`, which is `2.9999999999999996`, so `floor` of it is 2. The
test expects 3 for both.

Results

elm-0.19.1

failran in 55 ms
Missing pattern: logBase 10 1000: 3
--- output ---
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
logBase 10 1000: 2.9999999999999996
floor: 2

elm-0.19.2

failran in 43 ms
Missing pattern: logBase 10 1000: 3
--- output ---
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
logBase 10 1000: 2.9999999999999996
floor: 2

elm-0.19.3

failran in 77 ms
Missing pattern: logBase 10 1000: 3
--- output ---
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
logBase 10 1000: 2.9999999999999996
floor: 2

lamdera-1.5.0

failran in 44 ms
Missing pattern: logBase 10 1000: 3
--- output ---
logBase 10 1000: 2.9999999999999996
floor: 2

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-core/CoreIssue1048LogBaseTenTest] in its title.

Source

The -- CHECK: lines give the expected output.

module CoreIssue1048LogBaseTenTest exposing (main)
{-| `logBase 10 1000` is exactly 3.
<https://github.com/elm/core/issues/1048>
Elm 0.19.1 computes `log 1000 / log 10`, which is `2.9999999999999996`, so `floor` of it is 2. The
test expects 3 for both.
-}
-- TAGS: elm19-bug
-- CHECK: logBase 10 1000: 3
-- CHECK: floor: 3
import Html exposing (text)
main =
let
_ =
Debug.log "logBase 10 1000" (logBase 10 1000)
_ =
Debug.log "floor" (floor (logBase 10 1000))
in
text "done"