Code Monkey home page Code Monkey logo

go-formula's People

Contributors

pjebs avatar sandertv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-formula's Issues

Traffic

Can you please send me the traffic information for this package.

Insights -> Traffic -> Git clones and visitors.

Complex128

What is your opinion on a version that operates only complex 128 instead of real?

feature request: load constants

It would be a performance benefit if constants can be loaded at the time of Formula creation in New function.

func New(formula string, variables ...Variable) (*Formula, error) {
...
}

More functions

Can I add more built-in functions.

I can do a PR with more functions from the math package

Bug: panic pi^e

package main

import (
	"github.com/sandertv/go-formula/v2"
	"log"
)

func main() {
	f, err := formula.New("pi^e")
	if err != nil {
		log.Print(err)
		return
	}
	x := formula.Var("x", 4.5)
	z := formula.Var("z", 5)
	log.Printf("Formula output: %v", f.Eval(x, z))
}

See: https://play.golang.org/p/-Kit-m2jbhK

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4c84e1]

goroutine 1 [running]:
github.com/sandertv/go-formula/v2.(*Formula).Eval(0xc000096280, 0xc0000a0f48, 0x2, 0x2, 0x0)
	/tmp/gopath030862853/pkg/mod/github.com/sandertv/go-formula/[email protected]/formula.go:64 +0x281
main.main()
	/tmp/sandbox655706046/prog.go:16 +0x15e

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.