Skip to content

Commit

Permalink
Feat: Menambah fitur untuk menghitung volume bola (#92)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate (#66)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.1 → v0.2.2](astral-sh/ruff-pre-commit@v0.2.1...v0.2.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#69)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](astral-sh/ruff-pre-commit@v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#77)

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
- [github.com/MarcoGorelli/auto-walrus: v0.2.2 → 0.3.4](MarcoGorelli/auto-walrus@v0.2.2...0.3.4)
- [github.com/astral-sh/ruff-pre-commit: v0.3.2 → v0.4.3](astral-sh/ruff-pre-commit@v0.3.2...v0.4.3)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* chore(docs): menambahkan komentar kode (#90)

Signed-off-by: slowy07 <[email protected]>

* feat: menambahkan fungsi untuk menghitung volume bola

* Update OpenSeries/matematika.py

Co-authored-by: arfy slowy <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: slowy07 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: arfy slowy <[email protected]>
Co-authored-by: arfy slowy <[email protected]>
  • Loading branch information
4 people authored Aug 21, 2024
1 parent 8a37dc0 commit a45f862
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions OpenSeries/matematika.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,20 @@ def turunan(
return (f(x + h) - f(x)) / h


def volume_bola(r: Union[int, float]) -> Union[float, error.ErrorTipeData]:
"""
Menghitung volume dari sebuah bola
Args:
r (Union[int, float]): input radius
Return:
float : volume dari bola
"""
if not isinstance(r, (float, int)):
return error.ErrorTipeData(["float", "int"])
else:
return (4 / 3) * constant.PI * r**3


def mean_absolut_deviasi(
nilai: list[int],
) -> Union[error.Error, error.ErrorTipeData, float]:
Expand Down

0 comments on commit a45f862

Please sign in to comment.