gopherjs icon indicating copy to clipboard operation
gopherjs copied to clipboard

math.MaxFloat32 converted to int64 incorrectly:

Open nevkontakte opened this issue 1 year ago • 0 comments

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 avatar Aug 12 '23 20:08 nevkontakte