{"id":22701902,"url":"https://github.com/saphereye/quick-calc","last_synced_at":"2025-07-24T10:06:11.412Z","repository":{"id":236758322,"uuid":"790288424","full_name":"Saphereye/quick-calc","owner":"Saphereye","description":"A versatile calculator created using flex, bison and c++","archived":false,"fork":false,"pushed_at":"2024-06-06T08:51:26.000Z","size":408,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T20:17:46.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://saphereye.github.io/quick-calc/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saphereye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-22T15:55:53.000Z","updated_at":"2024-08-16T12:47:59.000Z","dependencies_parsed_at":"2024-06-06T10:06:12.960Z","dependency_job_id":"b1ee35df-625f-41f2-958a-6de9a213f64b","html_url":"https://github.com/Saphereye/quick-calc","commit_stats":null,"previous_names":["saphereye/flex_bison_calc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fquick-calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fquick-calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fquick-calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saphereye%2Fquick-calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saphereye","download_url":"https://codeload.github.com/Saphereye/quick-calc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246232772,"owners_count":20744711,"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":[],"created_at":"2024-12-10T07:11:02.048Z","updated_at":"2025-03-29T19:25:55.368Z","avatar_url":"https://github.com/Saphereye.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuickCalc\nA terminal-based calculator program was made using [flex](https://github.com/westes/flex), [bison](https://www.gnu.org/software/bison/), and C++.\n\n![Demo](./image.png)\n\n## Features\n- **Basic Arithmetic Operations:** Addition, subtraction, multiplication, and division are supported.\n- **Built-in Functions:** The calculator includes a variety of built-in functions such as trigonometric functions (sin, cos, tan), logarithmic functions (log, log10), exponential functions (exp), square root (sqrt), and [more](https://github.com/Saphereye/quick-calc/blob/f303041237272f3e912d50a133932d89e0586228/src/parser.y#L23).\n- **Reusing the previous answer:** The calculator keeps track of the previous answer and allows users to reference it in subsequent calculations using `_`. If you want to access the previous answer, use `_` in the calculation. If you want to use the answer two calculations ago, just use `__` (2 times `_`)\n- **Error Handling:** Comprehensive error handling for invalid input and mathematical errors.\n\n## Installation\n1. Requirements: \u003e=C++17, flex, bison\n2. **Clone the Repository**: Clone this repository to your local machine.\n\n    ```bash\n    git clone https://github.com/Saphereye/flex_bison_calc\n    ```\n3. **Build the project**\n\n    ```bash\n    cd flex_bison_calc\n    make repl\n    ```\n\n## Features\n- Basic arithmetic\n    ```bash\n    \u003e 3 * 4\n    12.000000\n    \u003e 255 ** 4\n    4228250625.000000\n    \u003e 1/6\n    0.166667\n    ```\n- Built-in functions\n    ```bash\n    \u003e sum(1, 2, 3, 4, 5, 6)\n    21.000000\n    \u003e sin(3.14)\n    0.001593\n    \u003e median(4, 5, 3, 2, 1)\n    3.000000\n    \u003e 10%3\n    1.000000\n    \u003e 10.1%3.1\n    0.800000\n    ```\n- Special functions and variables\n    ```bash\n    \u003e 5!\n    120.000000\n    \u003e 5.1!\n    142.451944\n    \u003e 5!!\n    6689502913449127120509299431182031258053015071153310066918800146811629520790841061032122839118801296905792978698449838385553111280551361744470298751804274423893297360062561614877543920066726903939072.000000\n    \u003e 4C2\n    6.000000\n    \u003e 4P2\n    12.000000\n    \u003e e\n    2.718282\n    \u003e pi\n    3.141593\n    ```\n- Referencing the previous answer\n    ```bash\n    \u003e 1+1\n    2.000000\n    \u003e _+1\n    3.000000\n    \u003e __+1\n    3.000000\n    ```\n- Descriptive error reporting\n    ```bash\n    \u003e 1+\n    Error [Line: 1 Column: 0]: syntax error, unexpected end of file\n    \u003e sin(1,,2)\n    Error [Line: 2 Column: 7]: syntax error, unexpected ','\n    \u003e sin(cos(sin(1) +))\n    Error [Line: 3 Column: 17]: syntax error, unexpected ')'\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaphereye%2Fquick-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaphereye%2Fquick-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaphereye%2Fquick-calc/lists"}