{"id":23213216,"url":"https://github.com/siman-man/rrpn","last_synced_at":"2025-04-05T12:44:37.664Z","repository":{"id":56892795,"uuid":"82552826","full_name":"siman-man/rrpn","owner":"siman-man","description":"Simple Reverse Polish Notation calculator and converter","archived":false,"fork":false,"pushed_at":"2017-03-04T20:14:43.000Z","size":13,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T04:33:35.954Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/siman-man.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-20T11:56:32.000Z","updated_at":"2017-02-22T01:05:15.000Z","dependencies_parsed_at":"2022-08-21T01:20:58.710Z","dependency_job_id":null,"html_url":"https://github.com/siman-man/rrpn","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Frrpn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Frrpn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Frrpn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siman-man%2Frrpn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siman-man","download_url":"https://codeload.github.com/siman-man/rrpn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339124,"owners_count":20923009,"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":["ruby"],"created_at":"2024-12-18T19:15:42.951Z","updated_at":"2025-04-05T12:44:37.643Z","avatar_url":"https://github.com/siman-man.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RRPN\n\n[![Build Status](https://travis-ci.org/siman-man/rrpn.svg?branch=master)](https://travis-ci.org/siman-man/rrpn)\n\nRRPN is Reverse Polish Notation calculator and converter, written in Ruby.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rrpn'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rrpn\n\n## Usage\n\nInteger\n\n```ruby\nrpn = '1 + 2 + 3'.to_rpn\np rpn.queue #=\u003e [1, 2, :+, 3, :+]\np rpn.calc  #=\u003e 6\nputs rpn    #=\u003e 1 2 + 3 +\n```\n\nFloat\n\n```ruby\nrpn = '(1.0 + 2.0) * 3'.to_rpn\np rpn.queue #=\u003e [1.0, 2.0, :+, 3, :*]\np rpn.calc  #=\u003e 9.0\nputs rpn    #=\u003e 1.0 2.0 + 3 *\n```\n\nRational\n\n```ruby\nrpn = '1/2r + 1/3r'.to_rpn\np rpn.queue #=\u003e [1, \"2r\", :/, 1, \"3r\", :/, :+]\np rpn.calc  #=\u003e (5/6)\nputs rpn    #=\u003e 1 2r / 1 3r / +\n```\n\nComplex\n\n```ruby\nrpn = '(1+2i) + (3+3i)'.to_rpn\np rpn.queue #=\u003e [1, \"2i\", :+, 3, \"3i\", :+, :+]\np rpn.calc  #=\u003e (4+5i)\nputs rpn    #=\u003e 1 2i + 3 3i + +\n```\n\nOther\n\n```ruby\nrpn = '(1 \u003c\u003c 3) + (16 \u003e\u003e 2)'.to_rpn\np rpn.queue #=\u003e [1, 3, :\u003c\u003c, 16, 2, :\u003e\u003e, :+]\np rpn.calc  #=\u003e 12\nputs rpn    #=\u003e 1 3 \u003c\u003c 16 2 \u003e\u003e +\n```\n\nCalculation\n\n```ruby\np RRPN.calc([3, 4, :*]) #=\u003e 12\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/siman-man/rrpn. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiman-man%2Frrpn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiman-man%2Frrpn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiman-man%2Frrpn/lists"}