mirror of
https://github.com/gonum/gonum.git
synced 2025-10-20 05:54:41 +08:00
all: convert ' to ′ and '' to ′′
This is necessary because gofmt in go1.19 imposes smart quotes on comments that use pairs of single quotes. Doubled-up single tick, U+2032, is chosen over double tick, U+2033, since the latter is harder to distinguish in many fonts at normally used font sizes, sometimes being indistinguishable from other superscript marks such as asterisk. Comparison: ′ ″ *
This commit is contained in:
@@ -17,14 +17,14 @@ func ExampleDerivative() {
|
||||
return math.Sin(x)
|
||||
}
|
||||
// Compute the first derivative of f at 0 using the default settings.
|
||||
fmt.Println("f'(0) ≈", fd.Derivative(f, 0, nil))
|
||||
fmt.Println("f′(0) ≈", fd.Derivative(f, 0, nil))
|
||||
// Compute the first derivative of f at 0 using the forward approximation
|
||||
// with a custom step size.
|
||||
df := fd.Derivative(f, 0, &fd.Settings{
|
||||
Formula: fd.Forward,
|
||||
Step: 1e-3,
|
||||
})
|
||||
fmt.Println("f'(0) ≈", df)
|
||||
fmt.Println("f′(0) ≈", df)
|
||||
|
||||
f = func(x float64) float64 {
|
||||
return math.Pow(math.Cos(x), 3)
|
||||
@@ -38,12 +38,12 @@ func ExampleDerivative() {
|
||||
OriginKnown: true,
|
||||
OriginValue: f(0),
|
||||
})
|
||||
fmt.Println("f''(0) ≈", df)
|
||||
fmt.Println("f′′(0) ≈", df)
|
||||
|
||||
// Output:
|
||||
// f'(0) ≈ 1
|
||||
// f'(0) ≈ 0.9999998333333416
|
||||
// f''(0) ≈ -2.999999981767587
|
||||
// f′(0) ≈ 1
|
||||
// f′(0) ≈ 0.9999998333333416
|
||||
// f′′(0) ≈ -2.999999981767587
|
||||
}
|
||||
|
||||
func ExampleJacobian() {
|
||||
|
Reference in New Issue
Block a user