polynomial

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LInt = new(big.Int).SetBytes([]byte{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0xde, 0xf9, 0xde, 0xa2, 0xf7, 0x9c, 0xd6, 0x58, 0x12, 0x63, 0x1a, 0x5c, 0xf5, 0xd3, 0xed})

Functions

This section is empty.

Types

type Poly

type Poly []*big.Int

Data structure for a polynomial Just an array in Reverse f(x) = 3x^3 + 2x + 1 => [1 2 0 3]

func (Poly) GetDegree

func (p Poly) GetDegree() int

GetDegree returns the degree if p = x^3 + 2x^2 + 5, GetDegree() returns 3

func (Poly) Mul

func (p Poly) Mul(q Poly, m *big.Int) Poly

P * Q

func (Poly) String

func (p Poly) String() (s string)

pretty print

func (Poly) Sub

func (p Poly) Sub(q Poly, m *big.Int) Poly

Sub() subtracts P from Q Since we already have Add(), Sub() does Add(P, -Q)

Jump to

Keyboard shortcuts

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