Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math.Exp does not handle underflow on darwin/amd64 #957

Closed
gopherbot opened this issue Jul 25, 2010 · 3 comments
Closed

math.Exp does not handle underflow on darwin/amd64 #957

gopherbot opened this issue Jul 25, 2010 · 3 comments

Comments

@gopherbot
Copy link
Contributor

by bcfabien:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?

package main
import (
    "fmt"
    "math"
)
func main() {
    var y, z float64
    y = -1.0e3
    z = math.Exp(y)
    fmt.Printf("y: %g, z: %g\n", y, z)
}

What is the expected output?

y: -1000, z: 0

What do you see instead?

y: -1000, z: -1.6403979450983092e+182

What is your $GOOS?  $GOARCH?

GOARCH=amd64
GOOS=darwin

Which revision are you using?  (hg identify)

5992bf56aa72 release.2010-07-14/release

Please provide any additional information below.

I do not see this problem on GOOS = linux, GOARCH = 386

I do not see this problem if I make a local copy of go/src/pkg/math/exp.go and call it
instead of math.Exp (see the attached file)

Attachments:

  1. testExp.go (5030 bytes)
@rsc
Copy link
Contributor

rsc commented Jul 25, 2010

Comment 1:

Wow!

Owner changed to r...@golang.org.

Status changed to Accepted.

@cldorian
Copy link
Contributor

Comment 2:

Sorry.  When I get power back, I'll submit a CL to fix this.

@rsc
Copy link
Contributor

rsc commented Aug 6, 2010

Comment 3:

This issue was closed by revision c8c2bdb.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants