{"id":16340785,"url":"https://github.com/casey/e","last_synced_at":"2025-09-05T11:46:38.473Z","repository":{"id":19795559,"uuid":"23055099","full_name":"casey/e","owner":"casey","description":"Expression evaluator","archived":false,"fork":false,"pushed_at":"2014-09-09T19:26:36.000Z","size":196,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-30T01:32:56.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"yiisoft/yii2-app-advanced","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casey.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}},"created_at":"2014-08-18T01:47:19.000Z","updated_at":"2020-07-29T19:01:37.000Z","dependencies_parsed_at":"2022-08-25T20:51:54.313Z","dependency_job_id":null,"html_url":"https://github.com/casey/e","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/casey/e","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casey","download_url":"https://codeload.github.com/casey/e/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273753489,"owners_count":25161910,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-10T23:57:53.149Z","updated_at":"2025-09-05T11:46:38.420Z","avatar_url":"https://github.com/casey.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"What is e?\n==========\n\ne is an evaluator for arithmetic expressions like `3*log(pi+10!)`, \n\nIt doesn't need bison or anything else other than a C compiler. In fact it is a recursive descent parser with one character lookahead.\n\ne's author is Apostolos Dimitromanolakis. Later, some idiot named Casey found it and put it on github.\n\nWhy does \"e --.+*.*^.+.--e^\" work and why does it return -1?\n------------------------------------------------------------\n\nRead the questions at the bottom!\n\nWhat is supported ?\n-------------------\n\nFirst of all you can use '[' instead of '(' and ']' instead of ')'. This is to avoid using quotes when writing an expression at the command line. For example, instead of:\n\n`$ e '5*log(2+3)'`\n\nyou can use the following (which is 2 keystrokes and 2 shifts shorter):\n\n`$ e 5*log[2+3]`\n\nYou can also omit the parenthesis of a function, for example:\n\n`$ e log1+log2+log3`\n\nFinally you can use the usual notation 5e7 = 5 * 10^7.\n\nOk, now what is available...\n\n```\noperators   explanation                 evaluation        precedence\n---------   -----------                 ----------        ----------\n + -        add,subtract                left to right     lower\n * / %      multiply, divide, modulo    left to right\n ^          exponentiate                right to left\n !          factorial                   obvious           higher\n\nconstants\n---------\ne            2.7182818284590452...\npi           3.14159265358979....\n\nfunctions                   explanation\n---------                   ----------\nabs, fabs                   absolute value \nfloor, ceil, sqrt, exp      like \u003cmath.h\u003e\nsin, cos, tan               like \u003cmath.h\u003e\nsinh, cosh, tanh            like \u003cmath.h\u003e\nasin, acos, atan            like \u003cmath.h\u003e\nasinh, acosh, atanh         like \u003cmath.h\u003e\nln                          natural logarithm (base e)\nlog                         base 2 logarithm (log256 = 8)\n```\n\nWhy does \"e +\" work and why does it return 0?\n---------------------------------------------\n\nRead the next question.\n\nWhy does \"e 5+\" work and why does it return 5?\n----------------------------------------------\n\nHave you ever wondered why +5 is a valid expression and 5+ isn't?  Read the next question.\n\nWhy doesn't \"e \" return 0 instead of a help message?\n----------------------------------------------------\n\nRead on...\n\nHow many 1-digit numbers are there in the universe?\n---------------------------------------------------\n\nPause for a moment and think..\nOk so, deep in the mathematical universe, there are...\n\n```\n9000   4 digit numbers     (from 1000 to 9999)\n 900   3 digit numbers     (from 100 to 999)\n  90   2 digit numbers     (from 10 to 99)\n```\n\nTherefore you should have guessed that we have...\n\n```\n   9   1 digit numbers     (from 1 to 9)\n```\n\nOk, if 0 isn't a 1-digit number, what is it?\n--------------------------------------------\n\nIt is a 0-digit number! That means you don't have to write anything when you want 0. Writing '0' for 0 is like writing '04' for 4.\n\nSo when we write:\n\n`+`\n\nit is equivalent to:\n\n`0+0`\n\nI hope everything is clear now! (for example e^ = e^0 = 1)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasey%2Fe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasey%2Fe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasey%2Fe/lists"}