big

package module
v0.0.0-...-91e276b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float

type Float struct {
	A, B *big.Float
}

Float is an imaginary number

func NewFloat

func NewFloat(a, b *big.Float) *Float

NewFloat creates a new imaginary number

func (*Float) Abs

func (f *Float) Abs(a *Float) *Float

Abs computes the absolute value of a

func (*Float) Add

func (f *Float) Add(a, b *Float) *Float

Add add two imaginary numbers

func (*Float) Arg

func (f *Float) Arg(x *Float) *Float

Arg computes arg(x + yi) = tan-1(y/x) https://mathworld.wolfram.com/ComplexArgument.html

func (*Float) Atan2

func (f *Float) Atan2(x *Float) *Float

Atan2 computes atan2 of x https://en.wikipedia.org/wiki/Atan2

func (*Float) Conj

func (f *Float) Conj(a *Float) *Float

Conj computes the complex conjugate of a

func (*Float) Div

func (f *Float) Div(a, b *Float) *Float

Div divides two imaginary numbers

func (*Float) Exp

func (f *Float) Exp(x *Float) *Float

Exp computes e^x for a complex number https://www.wolframalpha.com/input/?i=e%5E%28x+%2B+yi%29

func (*Float) Log

func (f *Float) Log(x *Float) *Float

Log computes the natural log of x https://en.wikipedia.org/wiki/Complex_logarithm

func (*Float) Mul

func (f *Float) Mul(a, b *Float) *Float

Mul multiples two imaginary numbers

func (*Float) Pow

func (f *Float) Pow(x *Float, y *Float) *Float

Pow computes x**y https://mathworld.wolfram.com/ComplexExponentiation.html

func (*Float) Rat

func (f *Float) Rat(r *Rational)

Rat stores the float in a rational

func (*Float) SetRat

func (f *Float) SetRat(r *Rational)

SetRat sets the value to a rational

func (*Float) Sqrt

func (f *Float) Sqrt(a *Float) *Float

Sqrt computes the square root of the complex number https://www.johndcook.com/blog/2020/06/09/complex-square-root/

func (*Float) String

func (f *Float) String() string

String returns a string of the imaginary number

func (*Float) Sub

func (f *Float) Sub(a, b *Float) *Float

Sub subtracts two imaginary numbers

type Rational

type Rational struct {
	A, B *big.Rat
}

Rational is an imaginary number

func NewRational

func NewRational(a, b *big.Rat) *Rational

NewRational creates a new imaginary number

func (*Rational) Add

func (r *Rational) Add(a, b *Rational) *Rational

Add add two imaginary numbers

func (*Rational) Conj

func (r *Rational) Conj(a *Rational) *Rational

Conj computes the complex conjugate of a

func (*Rational) Div

func (r *Rational) Div(a, b *Rational) *Rational

Div divides two imaginary numbers

func (*Rational) Mul

func (r *Rational) Mul(a, b *Rational) *Rational

Mul multiples two imaginary numbers

func (*Rational) Neg

func (r *Rational) Neg(a *Rational) *Rational

Neg negates the rational

func (*Rational) String

func (r *Rational) String() string

String returns a string of the imaginary number

func (*Rational) Sub

func (r *Rational) Sub(a, b *Rational) *Rational

Sub subtracts two imaginary numbers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址