dgcalculator


Namedgcalculator JSON
Version 0.0.1 PyPI version JSON
download
home_page
Summary
upload_time2023-10-05 04:54:37
maintainer
docs_urlNone
author
requires_python>=3.10
licenseThe MIT License (MIT) Copyright (c) 2023 dgelzinis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords calculator calculation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Calculator

Calculator is a Python package that contains functions for calculation actions:

- Addition / Subtraction.
- Multiplication / Division.
- Take (n) root of a number.

## Installation

Use the package manager pip to install calculator.

```
pip install dgcalculator
```

## Usage

```
>>> from calculator import Calculator
>>> calculator = Calculator()
```

Calculator has its own memory, calculator performs actions with
a value inside its memory until it is reset.
Calculations starts with the default memory value = 0

```
>>> calculator.result
0
```

### result

Returns current value in calculator memory e.g.:

```
>>> calculator.result
50
>>> calculator
50
>>> print(calculator)
50
```

### reset

Resets calculations to Zero.

```
>>> calculator.result
50
>>> calculator.reset()
0
```

### add

Adds number to current calculator memory value (result) e.g.:

```
>>> calculator.result
0
>>> calculator.add(50)
50
>>> calculator.add(-20)
30
```

### subtract

Subtracts number of current calculator memory value (result) e.g.:

```
>>> calculator.result
50
>>> calculator.subtract(50)
0
>>> calculator.subtract(-5)
5
```

### multiply

Multiplies current calculator memory value (result) by number e.g.:

```
>>> calculator.result
50
>>> calculator.multiply(-5)
-250
>>> calculator.multiply(25)
-10
```

### divide

Divides current calculator memory value (result) by number e.g.:

```
>>> calculator.result
50
>>> calculator.divide(5)
10.0
>>> calculator.divide(-5)
-2.0
```

### n root of a number

Calculates n root of current calculator memory value (result) e.g.:

```
>>> calculator.result
100
>>> calculator.root(2)
10.0
```

```
>>> calculator.result
100
>>> calculator.root(-2)
0.1
```

> **_NOTE:_**  Root of negative numbers is not supported yet, Error is raised.
> Root of negative numbers can only be determined using the imaginary
> number called an iota, or i. Iota.

## License

[MIT](https://choosealicense.com/licenses/mit/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dgcalculator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "calculator,calculation",
    "author": "",
    "author_email": "dgelzinis <d.gelzinis@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/dd/17/c2881a95a354bf646a67a30910d015470bb66f111948a57eacc8b346b90b/dgcalculator-0.0.1.tar.gz",
    "platform": null,
    "description": "# Calculator\n\nCalculator is a Python package that contains functions for calculation actions:\n\n- Addition / Subtraction.\n- Multiplication / Division.\n- Take (n) root of a number.\n\n## Installation\n\nUse the package manager pip to install calculator.\n\n```\npip install dgcalculator\n```\n\n## Usage\n\n```\n>>> from calculator import Calculator\n>>> calculator = Calculator()\n```\n\nCalculator has its own memory, calculator performs actions with\na value inside its memory until it is reset.\nCalculations starts with the default memory value = 0\n\n```\n>>> calculator.result\n0\n```\n\n### result\n\nReturns current value in calculator memory e.g.:\n\n```\n>>> calculator.result\n50\n>>> calculator\n50\n>>> print(calculator)\n50\n```\n\n### reset\n\nResets calculations to Zero.\n\n```\n>>> calculator.result\n50\n>>> calculator.reset()\n0\n```\n\n### add\n\nAdds number to current calculator memory value (result) e.g.:\n\n```\n>>> calculator.result\n0\n>>> calculator.add(50)\n50\n>>> calculator.add(-20)\n30\n```\n\n### subtract\n\nSubtracts number of current calculator memory value (result) e.g.:\n\n```\n>>> calculator.result\n50\n>>> calculator.subtract(50)\n0\n>>> calculator.subtract(-5)\n5\n```\n\n### multiply\n\nMultiplies current calculator memory value (result) by number e.g.:\n\n```\n>>> calculator.result\n50\n>>> calculator.multiply(-5)\n-250\n>>> calculator.multiply(25)\n-10\n```\n\n### divide\n\nDivides current calculator memory value (result) by number e.g.:\n\n```\n>>> calculator.result\n50\n>>> calculator.divide(5)\n10.0\n>>> calculator.divide(-5)\n-2.0\n```\n\n### n root of a number\n\nCalculates n root of current calculator memory value (result) e.g.:\n\n```\n>>> calculator.result\n100\n>>> calculator.root(2)\n10.0\n```\n\n```\n>>> calculator.result\n100\n>>> calculator.root(-2)\n0.1\n```\n\n> **_NOTE:_**  Root of negative numbers is not supported yet, Error is raised.\n> Root of negative numbers can only be determined using the imaginary\n> number called an iota, or i. Iota.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2023 dgelzinis  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "",
    "version": "0.0.1",
    "project_urls": {
        "repository": "https://github.com/TuringCollegeSubmissions/dgelzi-DWWP.1.git"
    },
    "split_keywords": [
        "calculator",
        "calculation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96ffbeeb1fb1f44af336be52565d0e7ec0c18061875ecf416190d966d9bd0b37",
                "md5": "0fc62738b3e7558910958c1af0910935",
                "sha256": "94c1fead211f7d3e8eb82449c2a36b666e01f1f52232e92458049c51a317b521"
            },
            "downloads": -1,
            "filename": "dgcalculator-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0fc62738b3e7558910958c1af0910935",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5253,
            "upload_time": "2023-10-05T04:54:35",
            "upload_time_iso_8601": "2023-10-05T04:54:35.757581Z",
            "url": "https://files.pythonhosted.org/packages/96/ff/beeb1fb1f44af336be52565d0e7ec0c18061875ecf416190d966d9bd0b37/dgcalculator-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd17c2881a95a354bf646a67a30910d015470bb66f111948a57eacc8b346b90b",
                "md5": "0f6f2aad21f58de55fd69eb436a68174",
                "sha256": "ee300fbca75eed41d6d51a927c6e9eff979df2d3116874b27abeb208b39a1678"
            },
            "downloads": -1,
            "filename": "dgcalculator-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0f6f2aad21f58de55fd69eb436a68174",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4805,
            "upload_time": "2023-10-05T04:54:37",
            "upload_time_iso_8601": "2023-10-05T04:54:37.553594Z",
            "url": "https://files.pythonhosted.org/packages/dd/17/c2881a95a354bf646a67a30910d015470bb66f111948a57eacc8b346b90b/dgcalculator-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-05 04:54:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TuringCollegeSubmissions",
    "github_project": "dgelzi-DWWP.1",
    "github_not_found": true,
    "lcname": "dgcalculator"
}
        
Elapsed time: 0.16567s