Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upBug: Integer Precision on PC versus Mac #696
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Aug 22, 2016
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Aug 22, 2016
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Aug 29, 2016
Member
This is due to the fact that Elm compiles to JS. Unless JS is different, or unless we compile to some other thing, I see no practical way to do anything about this. If there is some concrete proposal, we can talk about that in a new issue.
|
This is due to the fact that Elm compiles to JS. Unless JS is different, or unless we compile to some other thing, I see no practical way to do anything about this. If there is some concrete proposal, we can talk about that in a new issue. |
evancz
closed this
Aug 29, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
blogscot
Aug 30, 2016
Is this problem described above really a limitation of JS?
Chrome Output:
a = 2329871239
2329871239
a = 232987123992349237492734987234897239472394729347289
2.3298712399234924e+50
a = 2329871239923492374927349872348972394723947293472892304892309482034802348023948023984023984230948203480239482308402340238
2.3298712399234923e+120
Elm repl output
λ elm-repl
---- elm-repl 0.17.1 -----------------------------------------------------------
:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> a = 2329871239
-1965096057 : number
> a = 232987123992349237492734987234897239472394729347289
-1140926247 : number
> a = 2329871239923492374927349872348972394723947293472892304892309482034802348023948023984023984230948203480239482308402340238
179298702 : number
Iain
blogscot
commented
Aug 30, 2016
|
Is this problem described above really a limitation of JS? Chrome Output:
Elm repl output
Iain |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
blogscot
Aug 30, 2016
Ubuntu blows up after 18 steps:
---- elm-repl 0.17.1 -----------------------------------------------------------
:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> a = 10
10 : number
> a = 100
100 : number
> a = 1000
1000 : number
> a = 10000
10000 : number
> a = 100000
100000 : number
> a = 1000000
1000000 : number
> a = 10000000
10000000 : number
> a = 100000000
100000000 : number
> a = 1000000000
1000000000 : number
> a = 10000000000
10000000000 : number
> a = 100000000000
100000000000 : number
> a = 1000000000000
1000000000000 : number
> a = 10000000000000
10000000000000 : number
> a = 100000000000000
100000000000000 : number
> a = 1000000000000000
1000000000000000 : number
> a = 10000000000000000
10000000000000000 : number
> a = 100000000000000000
100000000000000000 : number
> a = 1000000000000000000
1000000000000000000 : number
> a = 10000000000000000000
-8446744073709552000 : number
Windows blows up after 9 steps:
λ elm-repl
---- elm-repl 0.17.1 -----------------------------------------------------------
:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> a = 10
10 : number
> a = 100
100 : number
> a = 1000
1000 : number
> a = 10000
10000 : number
> a = 100000
100000 : number
> a = 1000000
1000000 : number
> a = 10000000
10000000 : number
> a = 100000000
100000000 : number
> a = 1000000000
1000000000 : number
> a = 10000000000
1410065408 : number
> a = 100000000000
1215752192 : number
> a = 1000000000000
-727379968 : number
blogscot
commented
Aug 30, 2016
|
Ubuntu blows up after 18 steps:
Windows blows up after 9 steps:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Aug 30, 2016
Member
@evancz it looks like some part of this issue does have to do with the compiler. compiling this Elm:
module Main exposing (..)
a =
1000000000000000000000results in this JavaScript:
var _user$project$Main$a = 3875820019684212736;I'm going to open a bug on the compiler
There's a bug on elm-compiler about this already: elm/compiler#1246
|
@evancz it looks like some part of this issue does have to do with the compiler. compiling this Elm: module Main exposing (..)
a =
1000000000000000000000results in this JavaScript: var _user$project$Main$a = 3875820019684212736;
There's a bug on elm-compiler about this already: elm/compiler#1246 |
blogscot commentedAug 22, 2016
While trying to solve an exercism.io problem, I encountered the following issue:
On Windows 10 PC, Elm 0.17.1:
While on Mac OS X, Elm 0.17.1
This problem was discussed on the Elm Slack Channel, where it was confirmed that this issue was present on an independent Windows 10 machine running the same Elm version.