# go源码阅读笔记（math.4）

qq_15437667 · · 3192 次点击 · · 开始浏览

# go源码阅读笔记（math.4）

## API列表

### func Signbit(x float64) bool

``````func Signbit(x float64) bool {
return Float64bits(x)&(1<<63) != 0
}``````

### func Copysign(x, y float64) float64

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

### func Ceil(x float64) float64

``````Ceil(±0) = ±0
Ceil(±Inf) = ±Inf
Ceil(NaN) = NaN``````

### func Floor(x float64) float64

``````Floor(±0) = ±0
Floor(±Inf) = ±Inf
Floor(NaN) = NaN``````

### func Trunc(x float64) float64

``````Trunc(±0) = ±0
Trunc(±Inf) = ±Inf
Trunc(NaN) = NaN``````

### func Modf(f float64) (int float64, frac float64)

``````Modf(±Inf) = ±Inf, NaN
Modf(NaN) = NaN, NaN``````

### func Nextafter(x, y float64) (r float64)

func Abs(x float64) float64
func Max(x, y float64) float64
func Min(x, y float64) float64
func Dim(x, y float64) float64
func Mod(x, y float64) float64
func Remainder(x, y float64) float64
func Sqrt(x float64) float64
func Cbrt(x float64) float64
func Hypot(p, q float64) float64
func Sin(x float64) float64
func Cos(x float64) float64
func Tan(x float64) float64
func Sincos(x float64) (sin, cos float64)
func Asin(x float64) float64
func Acos(x float64) float64
func Atan(x float64) float64
func Atan2(y, x float64) float64
func Sinh(x float64) float64
func Cosh(x float64) float64
func Tanh(x float64) float64
func Asinh(x float64) float64
func Acosh(x float64) float64
func Atanh(x float64) float64
func Log(x float64) float64
func Log1p(x float64) float64
func Log2(x float64) float64
func Log10(x float64) float64
func Logb(x float64) float64
func Ilogb(x float64) int
func Frexp(f float64) (frac float64, exp int)
func Ldexp(frac float64, exp int) float64
func Exp(x float64) float64
func Expm1(x float64) float64
func Exp2(x float64) float64
func Pow(x, y float64) float64
func Pow10(e int) float64
func Gamma(x float64) float64
func Erf(x float64) float64
func Erfc(x float64) float64
func J0(x float64) float64
func J1(x float64) float64
func Jn(n int, x float64) float64
func Y0(x float64) float64
func Y1(x float64) float64
func Yn(n int, x float64) float64

0 回复

• 请尽量让自己的回复能够对别人有帮助
• 支持 Markdown 格式, **粗体**、~~删除线~~、``单行代码``
• 支持 @ 本站用户；支持表情（输入 : 提示），见 Emoji cheat sheet
• 图片支持拖拽、截图粘贴等方式上传

# go源码阅读笔记（math.4）

## API列表

### func Signbit(x float64) bool

``````func Signbit(x float64) bool {
return Float64bits(x)&(1<<63) != 0
}``````

### func Copysign(x, y float64) float64

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

### func Ceil(x float64) float64

``````Ceil(±0) = ±0
Ceil(±Inf) = ±Inf
Ceil(NaN) = NaN``````

### func Floor(x float64) float64

``````Floor(±0) = ±0
Floor(±Inf) = ±Inf
Floor(NaN) = NaN``````

### func Trunc(x float64) float64

``````Trunc(±0) = ±0
Trunc(±Inf) = ±Inf
Trunc(NaN) = NaN``````

### func Modf(f float64) (int float64, frac float64)

``````Modf(±Inf) = ±Inf, NaN
Modf(NaN) = NaN, NaN``````

### func Nextafter(x, y float64) (r float64)

func Abs(x float64) float64
func Max(x, y float64) float64
func Min(x, y float64) float64
func Dim(x, y float64) float64
func Mod(x, y float64) float64
func Remainder(x, y float64) float64
func Sqrt(x float64) float64
func Cbrt(x float64) float64
func Hypot(p, q float64) float64
func Sin(x float64) float64
func Cos(x float64) float64
func Tan(x float64) float64
func Sincos(x float64) (sin, cos float64)
func Asin(x float64) float64
func Acos(x float64) float64
func Atan(x float64) float64
func Atan2(y, x float64) float64
func Sinh(x float64) float64
func Cosh(x float64) float64
func Tanh(x float64) float64
func Asinh(x float64) float64
func Acosh(x float64) float64
func Atanh(x float64) float64
func Log(x float64) float64
func Log1p(x float64) float64
func Log2(x float64) float64
func Log10(x float64) float64
func Logb(x float64) float64
func Ilogb(x float64) int
func Frexp(f float64) (frac float64, exp int)
func Ldexp(frac float64, exp int) float64
func Exp(x float64) float64
func Expm1(x float64) float64
func Exp2(x float64) float64
func Pow(x, y float64) float64
func Pow10(e int) float64
func Gamma(x float64) float64