{"id":26486581,"url":"https://github.com/r-dziewaltowski/classiccalculator","last_synced_at":"2026-02-25T02:31:04.612Z","repository":{"id":264201871,"uuid":"892633388","full_name":"r-dziewaltowski/ClassicCalculator","owner":"r-dziewaltowski","description":"A classic calculator engine that responds to pressing buttons and provides output including display value.","archived":false,"fork":false,"pushed_at":"2025-03-20T00:05:27.000Z","size":9797,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T00:26:45.568Z","etag":null,"topics":["arithmetic","calculator","csharp","dotnet","library","math","nuget"],"latest_commit_sha":null,"homepage":"","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/r-dziewaltowski.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}},"created_at":"2024-11-22T13:37:03.000Z","updated_at":"2025-03-20T00:05:30.000Z","dependencies_parsed_at":"2025-01-02T19:25:16.688Z","dependency_job_id":"41dceab3-d40d-4ab0-920a-e7b9ee8c8917","html_url":"https://github.com/r-dziewaltowski/ClassicCalculator","commit_stats":null,"previous_names":["r-dziewaltowski/classiccalculator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dziewaltowski%2FClassicCalculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dziewaltowski%2FClassicCalculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dziewaltowski%2FClassicCalculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dziewaltowski%2FClassicCalculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-dziewaltowski","download_url":"https://codeload.github.com/r-dziewaltowski/ClassicCalculator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244560827,"owners_count":20472294,"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":["arithmetic","calculator","csharp","dotnet","library","math","nuget"],"created_at":"2025-03-20T06:19:51.573Z","updated_at":"2025-03-20T06:19:52.994Z","avatar_url":"https://github.com/r-dziewaltowski.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Classic Calculator\nA classic calculator engine that responds to pressing buttons and provides output including display value.\n\n## Table of Contents\n- [Description](#description)\n- [Features](#features)\n- [Usage](#usage)\n- [License](#license)\n\n## Description\nIt's a simple library that enables the user to create a calculator application or functionality without implementing any of the internal logic on their own. All they have to provide is a user interface that calls the library in response to user actions (e.g. pressing buttons) and presents the display value.\n\n## Features\nThe following actions/buttons are currently supported:\n- Digits (0-9)\n- Decimal point (.)\n- Toggle sign (+/-)\n- Add (+)\n- Subtract (-)\n- Multiply (*)\n- Divide (/)\n- Calculate/Equals (=)\n- Percent (%)\n- Sqaure root (√)\n- Clear (C)\n\nAt the moment the only output is the display value but more details will be returned in the future versions.\n\nWhen creating the calculator object, the user must provide the display length in the constructor which specifies how many digits can be displayed. This will affect the calculator in the same way as it normally does on the physical devices:\n1) User input is limited to the display length\n2) An error occurs when the integer part of the display value is too large to fit in the display\n3) The least meaningful digits of the decimal part of the display value are truncated to fit in the display \n\nThe user can also provide a logger object in the constructor that will be used internally by the library.\n\nMissing functionality:\n- Memory features (M+, M-, etc.)\n- CE (clear last entry)\n- Other features of more advanced calculators\n\n## Usage\nAn example usage:\n```csharp\nvar calculator = new Calculator(9); // Display can show up to 9 digits (DisplayValue = 0)\ncalculator.PressButton(CalculatorButton.One) // (DisplayValue = 1)\ncalculator.PressButton(CalculatorButton.Add) // (DisplayValue = 1)\ncalculator.PressButton(CalculatorButton.Five) // (DisplayValue = 5)\ncalculator.PressButton(CalculatorButton.Equals) // (DisplayValue = 6)\nvar displayValue = calculator.DisplayValue; \n```\n\nFor more details, please refer to the provided documentation.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-dziewaltowski%2Fclassiccalculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-dziewaltowski%2Fclassiccalculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-dziewaltowski%2Fclassiccalculator/lists"}