mirror of
https://github.com/make-42/xyosc
synced 2025-01-18 18:57:10 +01:00
9 lines
176 B
Go
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)
|
|
}
|