{"id":19992807,"url":"https://github.com/Giorgi/Math-Expression-Evaluator","last_synced_at":"2025-05-04T12:30:24.956Z","repository":{"id":2959843,"uuid":"3974295","full_name":"Giorgi/Math-Expression-Evaluator","owner":"Giorgi","description":"A C# library for parsing mathemitical expressions with support for parentheses and variables.","archived":false,"fork":false,"pushed_at":"2025-04-18T13:07:23.000Z","size":329,"stargazers_count":113,"open_issues_count":2,"forks_count":29,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-19T01:21:07.724Z","etag":null,"topics":["c-sharp","expression-evaluator","math-expression-evaluator","netstandard","netstandard20"],"latest_commit_sha":null,"homepage":"https://www.giorgi.dev/net-framework/building-expression-evaluator-with-expression-trees-in-csharp-table-of-contents/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Giorgi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Giorgi","custom":"https://buymeacoff.ee/giorgidev","ko_fi":"giorgi"}},"created_at":"2012-04-09T18:06:22.000Z","updated_at":"2025-04-18T13:07:27.000Z","dependencies_parsed_at":"2024-06-19T10:02:19.553Z","dependency_job_id":"22b3e5e5-1f26-4e6f-8b21-33ef97840952","html_url":"https://github.com/Giorgi/Math-Expression-Evaluator","commit_stats":{"total_commits":45,"total_committers":6,"mean_commits":7.5,"dds":0.6444444444444444,"last_synced_commit":"17c9594b749d689f3c9444dec11f63741e7d674a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giorgi%2FMath-Expression-Evaluator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giorgi%2FMath-Expression-Evaluator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giorgi%2FMath-Expression-Evaluator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giorgi%2FMath-Expression-Evaluator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Giorgi","download_url":"https://codeload.github.com/Giorgi/Math-Expression-Evaluator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252333945,"owners_count":21731300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","expression-evaluator","math-expression-evaluator","netstandard","netstandard20"],"created_at":"2024-11-13T04:52:19.830Z","updated_at":"2025-05-04T12:30:24.951Z","avatar_url":"https://github.com/Giorgi.png","language":"C#","funding_links":["https://github.com/sponsors/Giorgi","https://buymeacoff.ee/giorgidev","https://ko-fi.com/giorgi"],"categories":["C\\#"],"sub_categories":[],"readme":"# Math Expression Evaluator\n\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Math-Expression-Evaluator?style=for-the-badge)](https://www.nuget.org/packages/Math-Expression-Evaluator/)\n[![NuGet Version](https://img.shields.io/nuget/v/Math-Expression-Evaluator?style=for-the-badge)](https://www.nuget.org/packages/Math-Expression-Evaluator/)\n\n\n## Sponsors\n\n[Entity Framework Extensions](https://entityframework-extensions.net/) and [Dapper Plus](https://dapper-plus.net/) are major sponsors and are proud to contribute to the development of Math Expression Evaluator.\n\n[![Entity Framework Extensions - Sponsor](https://raw.githubusercontent.com/Giorgi/Math-Expression-Evaluator/master/.github/sponsors/entity-framework-extensions-sponsr.png)](https://entityframework-extensions.net/bulk-insert)\n\n[![Dapper Plus - Sponsor](https://raw.githubusercontent.com/Giorgi/Math-Expression-Evaluator/master/.github/sponsors/dapper-plus-sponsor.png)](https://dapper-plus.net/bulk-insert)\n\n## Usage\n\nMath Expression Evaluator is a library for evaluating simple mathematical expressions. It supports simple expressions such as `2.5+5.9`, `17.89-2.47+7.16`, `5/2/2+1.5*3+4.58`, expressions with parentheses `(((9-6/2)*2-4)/2-6-1)/(2+24/(2+4))` and expressions with variables:\n\n``` csharp\n\nvar a = 6;\nvar b = 4.32m;\nvar c = 24.15m;\nAssert.That(engine.Evaluate(\"(((9-a/2)*2-b)/2-a-1)/(2+c/(2+4))\", new { a, b, c}), \n            Is.EqualTo((((9 - a / 2) * 2 - b) / 2 - a - 1) / (2 + c / (2 + 4))));\n```\nIt is also possible to specify variables by using named arguments like this:\n\n``` csharp\n\ndynamic dynamicEngine = new ExpressionEvaluator();\n\nvar a = 6;\nvar b = 4.5m;\nvar c = 2.6m;\nAssert.That(dynamicEngine.Evaluate(\"(c+b)*a\", a: 6, b: 4.5, c: 2.6),\n            Is.EqualTo((c + b) * a));\n```\n\n## Installation\n\n```\ndotnet add package Math-Expression-Evaluator\n```\n\n## User Feedback\n\nFrom https://stackoverflow.com/questions/50722680/methods-for-dynamically-creating-an-array-in-c-sharp\n\nDavidG\n\u003e Can't decide if this library is evil, genius or evil genius...\n\nxanatos\n\u003e That library is using high level magic... Very high level :-)\n\n\u003e The class is dynamic and is handling in a dynamic way the use of the method... fascinating\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGiorgi%2FMath-Expression-Evaluator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGiorgi%2FMath-Expression-Evaluator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGiorgi%2FMath-Expression-Evaluator/lists"}