Skip to content

math: Expm1(x) returns +Inf not -1 when x < -709 #11442

@ncw

Description

@ncw

Demonstration: http://play.golang.org/p/APVWO63Dep

    for i := -1; i >= -1000; i-- {
        x := float64(i)
        fmt.Printf("expm1(%g) = %g\n", x, math.Expm1(x))
    }

Output (snipped)

expm1(-703) = -1
expm1(-704) = -1
expm1(-705) = -1
expm1(-706) = -1
expm1(-707) = -1
expm1(-708) = -1
expm1(-709) = -1
expm1(-710) = +Inf
expm1(-711) = +Inf
expm1(-712) = +Inf
expm1(-713) = +Inf
expm1(-714) = +Inf
expm1(-715) = +Inf
expm1(-716) = +Inf
expm1(-717) = +Inf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions