Code Monkey home page Code Monkey logo

regexmath's Introduction

RegexMath Build Status CodeFactor

A math engine written in C# using RegEx.

Why?

Because why not?

Examples

RegexMath.Evaluate("5+(-5(0.431e4*(5)(4)))*3.430e2(.509194e-5)-40.05245");
// -787.80921602

Regexmath.Evaluate("sqrt(5)+5^2PI+H_3/log(e, 3)");
// 82.444656232727
var input = "broken";
RegexMath.TryEvaluate(input, our var result);
// False

Features

Standard Arithmetic:

^, **, *, /, %, +, and -

Constants:

PI and E

Standard Math functions:

  • sqrt(x)
  • cbrt(x)
  • root(x, y)
  • log_x(y) or log(x, y)
  • min(x, y) or max(x, y)

and a lot more...

Programming constructs:

  • Modulo
  • Remainder
  • Bitshift

Complex calcuations:

  • Factorial on non-natural numbers
  • Euler Beta functions
  • Error functions
  • Sigmoid: Logistic functions
  • Gamma functions
  • Harmonic numbers
  • Trigonometry

TODO:

  • Summation in the form of Σ/sum/sigma[i=1, 6][3i + 4]
  • Product in the form of Π/prod/product[i=1, 3][3i + 4]
  • Variable substitution
  • Differential equations
  • Numerical stability
  • Conversion between radian, degree, and grad

Some of the functions can be found in Math.Net or Typing Math as text

regexmath's People

Contributors

sabihoshi avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

echoechoooo

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.