Skip to content

Negative exponentials produce floats that are typed as ints. #2347

Description

@jfeaver

Quick Summary: When you raise a number to a negative exponent then you often end up with a fraction. In Elm, the arguments to pow can be specified as Int and then pow (or (^)) returns an Int that should be a Float.

SSCCE (in elm repl)

> a : Int
| a = 2
|
2 : Int
> b : Int
| b = -1
|
-1 : Int
> a ^ b
0.5 : Int
  • Elm: 0.19.1
  • Browser: N/A
  • Operating System: macOS 15.6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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