xyosc/vendor/github.com/chewxy/math32/copysign.go
2024-12-21 17:38:26 +01:00

9 lines
176 B
Go

package math32
import "math"
func Copysign(x, y float32) float32 {
const sign = 1 << 31
return math.Float32frombits(math.Float32bits(x)&^sign | math.Float32bits(y)&sign)
}