{"id":13783068,"url":"https://github.com/microsounds/hpsh","last_synced_at":"2025-05-11T17:30:44.429Z","repository":{"id":112182691,"uuid":"57186050","full_name":"microsounds/hpsh","owner":"microsounds","description":"A stack-based Reverse Polish Notation (RPN) interpreter. Recreate the feel of Hewlett-Packard calculators!","archived":false,"fork":false,"pushed_at":"2016-06-16T16:16:20.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T18:18:11.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsounds.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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}},"created_at":"2016-04-27T05:31:08.000Z","updated_at":"2020-09-29T00:43:59.000Z","dependencies_parsed_at":"2023-05-11T04:00:28.820Z","dependency_job_id":null,"html_url":"https://github.com/microsounds/hpsh","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsounds%2Fhpsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsounds%2Fhpsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsounds%2Fhpsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsounds%2Fhpsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsounds","download_url":"https://codeload.github.com/microsounds/hpsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253604421,"owners_count":21934857,"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-08-03T18:01:52.307Z","updated_at":"2025-05-11T17:30:44.173Z","avatar_url":"https://github.com/microsounds.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"## hpsh - Stack-based Reverse Polish Notation Calculator\n![version] ![license]\n\n```hpsh``` is a minimal implementation of Entry RPN that recreates the feel of Hewlett-Packard RPN calculators.\n\nA CLI-based RPN interpreter with an unlimited stack depth!\n\n### Usage\nUse ```hpsh``` just like you would a real RPN calculator. ```hpsh``` does not evaluate until you press **ENTER**.\n```\nCommand:   | 8.33 ENTER | 4 ENTER | 5.2 - ENTER | * ENTER   |\n\nStack:     | 1: 8.33    | 2: 8.33 | 2: 8.33     | 1: -9.996 |\n                        | 1: 4    | 1: -1.2     |\n```\nEntering values without a corresponding operator will push them to the stack.\n\nFor example, pressing ```32 14 27 19 / ENTER``` will produce\n```\n3: 32\n2: 14\n1: 1.42105\n```\nThe result of all your commands is reflected on the stack, which is unlimited in depth.\nThe current state of the stack updates only when you press **ENTER**.\nYou can evaluate an arbitrary amount of values and operators all at once, but Entry RPN is much more intutive when you push values to the stack and use it to visualize your intermediate calculations.\n\n\n### About RPN\nRPN is a postfix notation. Instead of ```3 * 4``` you write ```3 4 *```.\n\nRPN doesn't use parentheses to enforce operator precedence, instead, it forces the user to account for order of operations.\nWhile it may seem backwards, it's actually quite intuitive for large equations. The stack allows you to visualize operations like you would on paper, letting you push nested values up into the stack until you need them.\n\nThis encourages the user to consciously break an equation down into smaller pieces and calculate them one at a time, pushing intermediate results to the stack and collapsing them to form a final answer.\n```\nAlgebraic\nsqrt( (8.33(4 - 5.2) / ((8.33 - 7.46)0.32)) / (4.3(3.15 - 2.75) - (1.71)(2.01)) )\n= 4.57278428023\n\nEntry RPN (E stands for ENTER, pushing a value to the stack without performing operations on it)\n8.33 E 4 E 5.2 - * 8.33 E 7.46 - 0.32 * / 4.3 E 3.15 E 2.75 - * 1.71 E 2.01 * / sqrt\n1: 4.57278428023\n```\nIf you're having trouble visualizing RPN, try to imagine the way you do calculations on paper. \nThe first number can be pushed to the stack, while the second number is paired with an operator to perform math.\nThat's all there is to RPN.\n```\nAlgebraic     RPN       Paper      \n3 * 4         3 ENTER   3\n= 12          4 *       4 x\n              1: 12     ----\n                        12\n```\nFor more information, see [Reverse Polish Notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation) on Wikipedia.\n\n### Building\n```git clone``` into this repository or grab the latest stable release as a zip or tarball from the [Releases](https://github.com/microsounds/hpsh/releases) tab.\n\nRun ```make``` to build, or ```sudo make install``` if you want to install it to your system.\n\n### Issues\nOpen an issue or pull request if you find any bugs.\n\n### Copyright / License\n```\nhpsh - Stack-based Reverse Polish Notation Calculator\nCopyright (C) 2016 microsounds \u003chttps://github.com/microsounds\u003e\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```\n\n[version]: https://img.shields.io/badge/version-v0.3.1-brightgreen.svg?style=flat)\n[license]: https://img.shields.io/badge/license-GPLv3-red.svg?style=flat)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosounds%2Fhpsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosounds%2Fhpsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosounds%2Fhpsh/lists"}