1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:31:22 -06:00
go/src/pkg/math
Andrew Gerrand 11e113db57 godoc: make example code more readable with new comment convention
go/doc: move Examples to go/ast
cmd/go: use go/doc to read examples
src/pkg: update examples to use new convention

This is to make whole file examples more readable. When presented as a
complete function, preceding an Example with its output is confusing.
The new convention is to put the expected output in the final comment
of the example, preceded by the string "output:" (case insensitive).

An idiomatic example looks like this:

// This example demonstrates Foo by doing bar and quux.
func ExampleFoo() {
        // example body that does bar and quux

        // Output:
        // example output
}

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5673053
2012-02-16 11:50:28 +11:00
..
big godoc: make example code more readable with new comment convention 2012-02-16 11:50:28 +11:00
cmplx build: remove Make.pkg, Make.tool 2012-01-30 23:43:46 -05:00
rand build: remove Make.pkg, Make.tool 2012-01-30 23:43:46 -05:00
abs_386.s math: remove the leading F from Fabs etc. 2011-09-29 09:54:20 -07:00
abs_amd64.s math: remove the leading F from Fabs etc. 2011-09-29 09:54:20 -07:00
abs_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
abs.go math: regularize build 2011-12-13 15:20:12 -05:00
acosh.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
all_test.go doc: fix comments referring to removed API funcs 2012-01-14 10:59:45 -08:00
asin_386.s
asin_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
asin_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
asin.go math: regularize build 2011-12-13 15:20:12 -05:00
asinh.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
atan2_386.s build: clear execute bit from source files 2011-10-06 18:33:13 +09:00
atan2_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
atan2_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
atan2.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
atan_386.s
atan_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
atan_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
atan.go math: regularize build 2011-12-13 15:20:12 -05:00
atanh.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
bits.go math: remove the leading F from Fabs etc. 2011-09-29 09:54:20 -07:00
cbrt.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
const.go math: fix gamma doc, link to OEIS 2012-02-10 15:56:51 +11:00
copysign.go
dim_386.s math: regularize build 2011-12-13 15:20:12 -05:00
dim_amd64.s math: document special-cases behavior for Dim, Max and Min 2011-12-07 14:52:17 -05:00
dim_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
dim.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
erf.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
exp2_386.s
exp2_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
exp2_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
exp_386.s
exp_amd64.s
exp_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
exp.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
expm1_386.s
expm1_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
expm1_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
expm1.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
export_test.go math: delete non-Sqrt-based Hypot 2011-12-13 17:08:56 -05:00
floor_386.s
floor_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
floor_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
floor.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
fltasm_amd64.s
frexp_386.s
frexp_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
frexp_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
frexp.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
gamma.go math: fix gamma doc, link to OEIS 2012-02-10 15:56:51 +11:00
hypot_386.s
hypot_amd64.s
hypot_arm.s math: delete non-Sqrt-based Hypot 2011-12-13 17:08:56 -05:00
hypot.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
j0.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
j1.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
jn.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
ldexp_386.s
ldexp_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
ldexp_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
ldexp.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
lgamma.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
log1p_386.s
log1p_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
log1p_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
log1p.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
log10_386.s
log10_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
log10_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
log10.go math: regularize build 2011-12-13 15:20:12 -05:00
log_386.s
log_amd64.s
log_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
log.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
logb.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
mod_386.s math: remove the leading F from Fabs etc. 2011-09-29 09:54:20 -07:00
mod_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
mod_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
mod.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
modf_386.s
modf_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
modf_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
modf.go math: regularize build 2011-12-13 15:20:12 -05:00
nextafter.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
pow10.go math: special cases for Pow10; delete BUG 2011-12-08 22:06:33 -05:00
pow.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
remainder_386.s
remainder_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
remainder_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
remainder.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
signbit.go
sin_386.s
sin_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
sin_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
sin.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
sincos_386.s
sincos_amd64.s
sincos_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
sincos.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
sinh.go math: add special-cases comments to Sinh and Tanh. 2011-12-05 14:01:24 -05:00
sqrt_386.s
sqrt_amd64.s
sqrt_arm.s math: add sqrt_arm.s and sqrtGoC.go as fallback to soft fp emulation 2011-06-09 17:19:08 -04:00
sqrt.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
tan_386.s
tan_amd64.s math: regularize build 2011-12-13 15:20:12 -05:00
tan_arm.s math: regularize build 2011-12-13 15:20:12 -05:00
tan.go pkg/math: undo manual inlining of IsInf and IsNaN 2012-02-01 16:08:31 +01:00
tanh.go math: add special-cases comments to Sinh and Tanh. 2011-12-05 14:01:24 -05:00
unsafe.go