go abs 源码

2022-07-15 浏览 (1121)

golang abs 代码

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

/ Copyright 2009 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

/ Abs returns the absolute value of x.
/
/ Special cases are:
/
/	Abs(±Inf) = +Inf
/	Abs(NaN) = NaN
func Abs(x float64) float64 {
	return Float64frombits(Float64bits(x) &^ (1 << 63))
}

相关信息

go 源码目录

相关文章

go acosh 源码

go all_test 源码

go arith_s390x 源码

go arith_s390x_test 源码

go asin 源码

go asinh 源码

go atan 源码

go atan2 源码

go atanh 源码

go bits 源码

^