Giter Site home page Giter Site logo

kovtunv / nostringevaluating Goto Github PK

View Code? Open in Web Editor NEW
26.0 1.0 8.0 1.54 MB

Fast low memory consuming mathematical evaluation without endless string parsing! Parses string formula once and uses its object sequence in each evaluation. Moreover, provides user defined functions and variables.

License: MIT License

C# 99.08% HTML 0.92%
math mathematics mathematical-expression expressions parser formula evaluator calculator solve calculation

nostringevaluating's People

Contributors

ivotops avatar kovtunv 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

Watchers

 avatar

nostringevaluating's Issues

Some hints to improve the quality of the benchmark

Hi,

Many thanks for the lib and the benchmark. mXparser does not fight strictly for the performance - the main focus is the functionality. Anyway it is a great comparison. Before running the benchmark always turn off all the smart rounding settings - especially the canonical option is very heavy.

Please see more here: https://mathparser.org/mxparser-tutorial/smart-rounding-settings/
And here: https://mathparser.org/mxparser-tutorial/efficient-calculations-in-loops/
And here: https://mathparser.org/mxparser-tutorial/expression-pre-compilation/

Best regards :-)

Stack overflow during dispose

Hi again!

I've been using the library for a while now but I've noticed that during shutdown, when disposing my IOC container, the library throws a stack overflow exception.

I implemented the Ninject module pretty much exactly as in the example you provided: https://github.com/Artemis-RGB/Artemis/blob/VisualScripting/src/Artemis.VisualScripting/Ninject/NoStringNinjectModule.cs

I'm not sure what kind of other useful information I can provide you with but hopefully this can be fixed, if you need anything let me know! :)

DateTime Functions

Hi,
Are DateTime Functions working?
DateDif(date1; date2; 'Y')?

If yes, Can give me an example

Null value and other improvements

  • null value and variable
  • options with behavior if there isn't a variable (throw exception or return null)
  • Implement functions IfNull and NullIf
    IfNull(x,3) => Returns 3 if x is Null
    NullIf(x,3) => Returns Null if x == 3
  • Boolean type
  • Improve unit tests
  • Object type
  • Evaluator interface with a nullable result
  • Change function registration approach
  • Evaluator builder with the least memory consumption
  • Update readme

Evaluator.Parse() throws unexpected exceptions

Evaluator.Parse() throws unexpected exceptions on malformed input.

Example 1:

var facade = NoStringEvaluator.CreateFacade();
var evaluator = facade.Evaluator;
evaluator.Calc("0(!(");

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List1.get_Item(Int32 index) at NoStringEvaluating.Functions.Logic.NotAliasFunction.Execute(List1 args, ValueFactory factory)
at NoStringEvaluating.NoStringEvaluator.CalcFunction(FunctionWrapperNode functionWrapper, VariablesSource variables, ValueKeeperContainer valueKeeperContainer)
at NoStringEvaluating.NoStringEvaluator.CalcInternal(List1 nodes, VariablesSource variables, ValueKeeperContainer valueKeeperContainer) at NoStringEvaluating.NoStringEvaluator.OnCalcAggregated(List1 nodes, VariablesSource variables)
at NoStringEvaluating.NoStringEvaluator.Calc(String formula)

Example 2:
evaluator.Calc("(");

System.InvalidOperationException: Stack empty.
at System.Collections.Generic.Stack1.ThrowForEmptyStack() at System.Collections.Generic.Stack1.Pop()
at NoStringEvaluating.NoStringEvaluator.CalcInternal(List1 nodes, VariablesSource variables, ValueKeeperContainer valueKeeperContainer) at NoStringEvaluating.NoStringEvaluator.OnCalcAggregated(List1 nodes, VariablesSource variables)
at NoStringEvaluating.NoStringEvaluator.Calc(String formula)

Use without extra dependencies

Hello,

I'd love to use this library in a dekstop application but I'd really rather stay away from a dependency on Microsoft.Extensions.DependencyInjection and friends.

Is it possible to use this without adding that dependency? I'm using Ninject.

Thanks in advance!

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.