Thanks to visit codestin.com
Credit goes to github.com

Skip to content

math.MaxFloat32 converted to int64 incorrectly: #1224

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

Open
nevkontakte opened this issue Aug 12, 2023 · 0 comments
Open

math.MaxFloat32 converted to int64 incorrectly: #1224

nevkontakte opened this issue Aug 12, 2023 · 0 comments

Comments

@nevkontakte
Copy link
Member

package main

import (
	"fmt"
	"math"
)

func main() {
	var f float32 = math.MaxFloat32
	fmt.Printf("Hello, playground: %x\n", int64(float32(f)))
}

Go output: -8000000000000000

GopherJS output: 0

https://gopherjs.github.io/playground/#/2uCovf4ywh
https://go.dev/play/p/m7yL_crK_Qb

@nevkontakte nevkontakte added this to the Go spec compliance milestone Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant