{"id":26155456,"url":"https://github.com/ntdls/ntdls.expressionparser","last_synced_at":"2026-02-09T01:03:44.973Z","repository":{"id":199986991,"uuid":"704691627","full_name":"NTDLS/NTDLS.ExpressionParser","owner":"NTDLS","description":"Expression parser for .net. Supports expression nesting, custom variables, custom functions as well as a ton of built in functions.","archived":false,"fork":false,"pushed_at":"2025-11-13T23:38:29.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-14T01:16:23.812Z","etag":null,"topics":["library","mathematics","nuget"],"latest_commit_sha":null,"homepage":"https://networkdls.com/Entity/ntdls-expressionparser","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NTDLS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-13T20:45:49.000Z","updated_at":"2025-11-13T23:38:21.000Z","dependencies_parsed_at":"2023-10-16T06:23:25.396Z","dependency_job_id":"df1a2692-7751-431d-a87f-bf872b447641","html_url":"https://github.com/NTDLS/NTDLS.ExpressionParser","commit_stats":null,"previous_names":["ntdls/ntdls.expressionparser"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/NTDLS/NTDLS.ExpressionParser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.ExpressionParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.ExpressionParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.ExpressionParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.ExpressionParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NTDLS","download_url":"https://codeload.github.com/NTDLS/NTDLS.ExpressionParser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.ExpressionParser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29252659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["library","mathematics","nuget"],"created_at":"2025-03-11T08:56:16.085Z","updated_at":"2026-02-09T01:03:44.967Z","avatar_url":"https://github.com/NTDLS.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NTDLS.ExpressionParser\n\n📦 Be sure to check out the NuGet package: https://www.nuget.org/packages/NTDLS.ExpressionParser\n\nExpressionParser is a mathematics parsing engine for .net. It supports expression nesting, custom variables, custom functions all standard mathematical operations for integer, decimal (floating point), logic and bitwise.\n\n🔥 Benchmarked at ~0.22 µs per expression (≈ 4.5M eval/s per core). That’s ~22M arithmetic ops/sec with our test expression.\nRoughly on par with compiled expression trees / LLVM-JIT math engines — this parser isn’t \"fast for C#\"; it’s *fast, period*.\n\nIt addition to the custom functions and variables, out of the box it supports: abs, acos, asin, atan, atan2, avg, ceil, clamp, cos, cosh, count, deg, e, exp, floor, hypot, if, log, log10, logn, modpow, not, pi, pow, prod, rad, rand, round, sign, sin, sinh, sqrt, sum, tan, tanh, trunc.\n\n[![Regression Tests](https://github.com/NTDLS/NTDLS.ExpressionParser/actions/workflows/Regression%20Tests.yml/badge.svg)](https://github.com/NTDLS/NTDLS.ExpressionParser/actions/workflows/Regression%20Tests.yml)\n\n👀 If you came for the C++ version you can find it at: https://github.com/NTDLS/CMathParser\n\n## Basic usage:\n\n\u003e**Simple Example:**\n\u003e\n\u003eIn this example we simply call the static function Expression.Evaluate to compute the string expression.\n```csharp\n\nvar result = Expression.Evaluate(\"10 * ((1000 / 5 + (10 * 11)))\");\nConsole.WriteLine($\"{result:n2}\");\n```\n\n\u003e**Simple Example (with work):**\n\u003e\n\u003eIn this example we simply call the static function Expression.Evaluate to compute the string expression, and we also supply an output parameter for which the parser will use to explain the operations.\n```csharp\n\nvar result = Expression.Evaluate(\"10 * ((1000 / 5 + (10 * 11))), out var explanation\");\n\nConsole.WriteLine($\"{result:n2}\");\nConsole.WriteLine(explanation);\n```\n\n\u003e**Advanced Example:**\n\u003e\n\u003eIn this example we will create an expression that uses two built in functions \"Ceil\" and \"Sum\", a custom function called \"DoStuff\" and one variable called \"extra\".\n```csharp\n\nvar expression = new Expression(\"10 * ((5 + extra + DoStuff(11,55) + ( 10 + !0 )) * Ceil(SUM(11.6, 12.5, 14.7, 11.11)) + 60.5) * 10\");\n\n//Add a value for the variable called \"extra\".\nexpression.AddParameter(\"extra\", 1000);\n\n//Handler for the custom function:\nexpression.AddFunction(\"DoStuff\", (double[] parameters) =\u003e\n{\n    double sum = 0;\n    foreach (var parameter in parameters)\n    {\n        sum += parameter;\n    }\n\treturn sum;\n});\n\nvar result = ExpressionParser.Evaluate(expression);\n\nConsole.WriteLine($\"{result:n2}\");\n\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntdls%2Fntdls.expressionparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntdls%2Fntdls.expressionparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntdls%2Fntdls.expressionparser/lists"}