Skip to content

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

@jfeaver

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions