Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ALTree/bigfloat

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ALTree/bigfloat

  • v0.2.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Package bigfloat provides arbitrary-precision natural logarithm and exponentiation for the standard library's big.Float type.

GoDoc

The package requires Go 1.10 or newer.

Example
package main

import (
	"fmt"
	"math/big"

	"github.com/ALTree/bigfloat"
)

// We'll compute the value of the transcendental number 2^√2, also
// known as the Gelfond–Schneider constant, to 1000 bits.
func main() {
	const prec = 1000 // in binary digits
	two := big.NewFloat(2).SetPrec(prec)
	sqrtTwo := new(big.Float).SetPrec(prec).Sqrt(two)

	// Pow uses the first argument's precision.
	gsc := bigfloat.Pow(two, sqrtTwo) // 2^√2
	fmt.Printf("gsc = %.60f\n", gsc)
}

outputs:

gsc = 2.665144142690225188650297249873139848274211313714659492835980
Documentation

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

FAQs

Package last updated on 22 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc