Skip to content

Modulo 0 Causes Infinite Recursion #262

@maxsnew

Description

@maxsnew
main = asText <| 3 `mod` 0

results in the error "Maximum call stack size exceeded", it seems like it should throw a nicer error like "Cannot divide by 0" (what Haskell does) or return NaN (what JavaScript does).

Actually, is NaN a valid Elm Int? It might be nice to better specify some of this, especially NaN and Infinity.

Running example: http://share-elm.com/sprout/523a9bf1e4b00f123dfa613e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions