2 Star 2 Fork 9

王布衣/gox

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
abs.go 208 Bytes
Copy Edit Raw Blame History
王布衣 authored 2023-08-13 11:51 . 升级go版本到1.21.0
package math32
// Abs returns the absolute value of x.
//
// Special cases are:
//
// Abs(±Inf) = +Inf
// Abs(NaN) = NaN
func Abs(x float32) float32 {
return Float32frombits(Float32bits(x) &^ (1 << 31))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/gox.git
git@gitee.com:quant1x/gox.git
quant1x
gox
gox
v1.15.8

Search