GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ThreeAndTwo/bigfloat: Additional operations for the standard library big.Float type

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

105 Commits
105 Commits

Folders and files

NameName
Last commit message
Last commit date
docs/security
docs/security
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
exp.go
exp.go
 
 
exp_test.go
exp_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
log.go
log.go
 
 
log_test.go
log_test.go
 
 
misc.go
misc.go
 
 
misc_test.go
misc_test.go
 
 
pow.go
pow.go
 
 
pow_test.go
pow_test.go
 
 
sqrt.go
sqrt.go
 
 
sqrt_test.go
sqrt_test.go
 
 

Repository files navigation

Floats

Package bigfloat provides the implementation of a few additional operations (square root, exponentiation, natural logarithm, exponential function) for the standard library big.Float type.

GoDoc

Install

go get github.com/ALTree/bigfloat

Please note that bigfloat requires Go >= 1.5 (since the big.Float type is not available in previous versions).

Example

package main

import (
	"fmt"
	"math/big"

	"github.com/ALTree/bigfloat"
)

// In this example, we'll compute the value of the
// transcendental number 2 ** √2, also known as
// the Gelfond–Schneider constant, to 1000 bits.
func main() {
	// Work with 1000 binary digits of precision.
	const prec = 1000

	two := big.NewFloat(2).SetPrec(prec)

	// Compute √2.
	// Sqrt uses the argument's precision.
	sqrtTwo := bigfloat.Sqrt(two)

	// Compute 2 ** √2
	// Pow uses the first argument's precision.
	gsc := bigfloat.Pow(two, sqrtTwo)

	// Print gsc, truncated to 60 decimal digits.
	fmt.Printf("gsc = %.60f...\n", gsc)
}

outputs

gsc = 2.665144142690225188650297249873139848274211313714659492835980...

Documentation

See https://godoc.org/github.com/ALTree/bigfloat

About

Additional operations for the standard library big.Float type

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.