Skip to content

Commit 5359a3e

Browse files
committed
README: update go version requirement and README
1 parent d63a53e commit 5359a3e

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

README.md

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
### Floats
2-
3-
Package bigfloat provides the implementation of a few additional operations (square root, exponentiation, natural logarithm, exponential function) for the standard library `big.Float` type.
1+
Package bigfloat provides arbitrary-precision natural logarithm and
2+
exponentiation for the standard library's `big.Float` type.
43

54
[![GoDoc](https://godoc.org/github.com/ALTree/bigfloat?status.png)](https://godoc.org/github.com/ALTree/bigfloat)
65

7-
#### Install
8-
9-
```
10-
go get github.com/ALTree/bigfloat
11-
```
12-
13-
Please note that `bigfloat` requires Go >= 1.5 (since the `big.Float` type is not available in previous versions).
6+
The package requires Go 1.10 or newer.
147

158
#### Example
169

@@ -24,31 +17,22 @@ import (
2417
"github.com/ALTree/bigfloat"
2518
)
2619

27-
// In this example, we'll compute the value of the
28-
// transcendental number 2 ** √2, also known as
29-
// the Gelfond–Schneider constant, to 1000 bits.
20+
// We'll compute the value of the transcendental number 2^√2, also
21+
// known as the Gelfond–Schneider constant, to 1000 bits.
3022
func main() {
31-
// Work with 1000 binary digits of precision.
32-
const prec = 1000
33-
23+
const prec = 1000 // in binary digits
3424
two := big.NewFloat(2).SetPrec(prec)
25+
sqrtTwo := new(big.Float).SetPrec(prec).Sqrt(two)
3526

36-
// Compute √2.
37-
// Sqrt uses the argument's precision.
38-
sqrtTwo := bigfloat.Sqrt(two)
39-
40-
// Compute 2 ** √2
4127
// Pow uses the first argument's precision.
42-
gsc := bigfloat.Pow(two, sqrtTwo)
43-
44-
// Print gsc, truncated to 60 decimal digits.
45-
fmt.Printf("gsc = %.60f...\n", gsc)
28+
gsc := bigfloat.Pow(two, sqrtTwo) // 2^√2
29+
fmt.Printf("gsc = %.60f\n", gsc)
4630
}
4731
```
4832

49-
outputs
33+
outputs:
5034
```
51-
gsc = 2.665144142690225188650297249873139848274211313714659492835980...
35+
gsc = 2.665144142690225188650297249873139848274211313714659492835980
5236
```
5337

5438
#### Documentation

0 commit comments

Comments
 (0)