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

MaxFloat64 overflows Float64 variable #201

Closed
gopherbot opened this issue Nov 15, 2009 · 3 comments
Closed

MaxFloat64 overflows Float64 variable #201

gopherbot opened this issue Nov 15, 2009 · 3 comments

Comments

@gopherbot
Copy link

by bertrand.marlier:

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?
1.compile the following source code with 8g:

// start of file
package main
import "math";
var value float64 = math.MaxFloat64;
// end of file

What is the expected output? What do you see instead?

expected: successful compilation, ie: constant MaxFloat64 can be assigned
to a Float64 variable.

instead:
maxfloat64.go:4: constant 1.79769e+308 overflows float64

What is your $GOOS?  $GOARCH?
linux/386

Which revision are you sync'ed to?  (hg log -l 1)

changeset:   4037:cd0140653802
tag:         tip
user:        David Titarenco <david.titarenco@gmail.com>
date:        Fri Nov 13 18:06:47 2009 -0800
summary:     Created new Conn.Flush() public method so the fd pipeline can
be drained arbitrarily by the user.

Please provide any additional information below.

The following does not work either:

var value float64 = float64(math.MaxFloat64);

But the following works:

var value float64 = 1.7976931348623157e+308;

or:

var value float64 = math.MinFloat64;
@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 1:

Labels changed: added compiler-bug.

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

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 2:

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 3:

This issue was closed by revision a338231.

Status changed to Fixed.

Merged into issue #-.

@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