go copysign 源码

  • 2022-07-15
  • 浏览 (935)

golang copysign 代码

文件路径:/src/math/copysign.go

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package math

// Copysign returns a value with the magnitude of f
// and the sign of sign.
func Copysign(f, sign float64) float64 {
	const signBit = 1 << 63
	return Float64frombits(Float64bits(f)&^signBit | Float64bits(sign)&signBit)
}

相关信息

go 源码目录

相关文章

go abs 源码

go acosh 源码

go all_test 源码

go arith_s390x 源码

go arith_s390x_test 源码

go asin 源码

go asinh 源码

go atan 源码

go atan2 源码

go atanh 源码

0  赞