Commit Graph

399 Commits

Author SHA1 Message Date
Ravi Kumar
7dbc301818
added rkf45 method (#10438)
* added rkf45 method

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

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

* Updated rkf45.py

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

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

* Updated rkf45.py

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

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

* Update rkf45.py

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

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

* Update rkf45.py with suggestions

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

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

* Improved Code Quality rkf45.py

* Added more test cases and exception rkf45.py

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

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

* Update rkf45.py

* corrected some spellings. rkf45.py

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

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

* Update rkf45.py

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

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

* Update rkf45.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-15 11:07:29 +02:00
Dale Dai
9fb0cd271e
Expand euler phi function doctest (#10401) 2023-10-14 02:47:08 -04:00
Saahil Mahato
ebe66935d2
Add Solovay-Strassen Primality test (#10335)
* Add Solovay-Strassen Primality test

* fix: resolve comments

* refactor: docs change
2023-10-13 08:04:48 +02:00
Vipin Karthic
92fbe60082
Added doctests to carmichael_number.py (#10210)
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-11 15:05:24 -04:00
Christian Clauss
3f094fe49d
Ruff pandas vet (#10281)
* Python linting: Add ruff rules for Pandas-vet and Pytest-style

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-11 14:30:02 -04:00
Aasheesh
d5323dbaee
Adding doctests in simpson_rule.py (#10269)
* Adding doctests in simpson_rule.py

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

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

* Update maths/simpson_rule.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update maths/simpson_rule.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Adding doctests in simpson_rule.py

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

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

* Adding doctests in simpson_rule.py

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

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

* Adding doctests in simpson_rule.py

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

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

* Adding doctests in simpson_rule.py

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

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

* Adding doctests in simpson_rule.py

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

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

* Update simpson_rule.py

* Adding doctests in simpson_rule.py

* Adding doctests in simpson_rule.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-11 20:20:18 +02:00
Ricardo Martinez Peinado
5fb6496d1b
Improve primelib.py test coverage #9943 (#10251)
* Update the doctest of primelib.py

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

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

* Correct errors for the doctest of primelib.py

* last error for the doctest of primelib.py

* last error for the doctest of primelib.py

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-11 12:11:05 +02:00
cornbread-eater
c850227bee
Add doctests to primelib.py (#10242)
* Update primelib.py

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-10 23:07:07 +02:00
Kamil
9a5a6c663c
carmichael_number - add doctests (#10038)
* Replacing the generator with numpy vector operations from lu_decomposition.

* Revert "Replacing the generator with numpy vector operations from lu_decomposition."

This reverts commit ad217c6616.

* Added doctests

* Update carmichael_number.py

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

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

* Update carmichael_number.py

I make an empty commit to reset:
tests are failing.

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

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

* Update carmichael_number.py

Made changes taking into account the addition: 
from maths.greatest_common_divisor import greatest_common_divisor.

Now instead of gcd it is used: greatest_common_divisor.

* Update carmichael_number.py

* Update carmichael_number.py

* Update carmichael_number.py

I added a check for 0 and negative numbers in the tests and the code itself. Simplified obtaining the final result.

* Update carmichael_number.py

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

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

* Update maths/carmichael_number.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update carmichael_number.py

* Update carmichael_number.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-10 16:14:13 -04:00
Vipin Karthic
6d13603667
Fixes #9943 Added Doctests to binary_exponentiation_3.py (#10121)
* Python mirror_formulae.py is added to the repository

* Changes done after reading readme.md

* Changes for running doctest on all platforms

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

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

* Change 2 for Doctests

* Changes for doctest 2

* updating DIRECTORY.md

* Doctest whitespace error rectification to mirror_formulae.py

* updating DIRECTORY.md

* Adding Thermodynamic Work Done Formulae

* Work done on/by body in a thermodynamic setting

* updating DIRECTORY.md

* updating DIRECTORY.md

* Doctest adiition to binary_exponentiation_3.py

* Change 1

* updating DIRECTORY.md

* Rename binary_exponentiation_3.py to binary_exponentiation_2.py

* updating DIRECTORY.md

* updating DIRECTORY.md

* Formatting

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-10 01:52:37 -04:00
AkhilYadavPadala
9c02f1220e
seperation between description and docstrings (#9687)
* seperation between description and docstrings

* Update maths/factorial.py

---------

Co-authored-by: sarayu sree <sarayusreeyadavpadala@gmail.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-10 01:13:32 -04:00
Md Mahiuddin
4f8fa3c44a
TypeError for non-integer input (#9250)
* type error check

* remove str input

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-10 00:19:40 -04:00
Dean Bring
b9a797f3d4
Added the Minkowski distance function (#10143)
* Added the Minkowski distance function

* Made error handling more precise

* Added note about floating point errors and corresponding doctest
2023-10-09 19:00:37 -04:00
Dean Bring
b0aa35c7b3
Added the Chebyshev distance function (#10144)
* Added the Chebyshev distance function

* Remove float cast and made error handling more precise
2023-10-09 17:21:46 -04:00
Siddik Patel
583a614fef
Removed redundant greatest_common_divisor code (#9358)
* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder

* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder, also fixed comments

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

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

* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder, also fixed comments

* Imports organized

* recursive gcd function implementation rolledback

* more gcd duplicates removed

* more gcd duplicates removed

* Update maths/carmichael_number.py

* updated files

* moved a file to another location

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-09 14:19:12 +02:00
Megan Payne
a2b695dabd
Added Germain primes algorithm to the maths folder (#10120)
* Added algorithm for Germain Primes to maths folder

* Fixed test errors Germain primes.

* Formatting Germain primes after pre-commit

* Fixed path to maths

* Update maths/germain_primes.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update maths/germain_primes.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Added function for safe primes

* Update maths/germain_primes.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Apply suggestions from code review

---------

Co-authored-by: Megan Payne <payneconsulting.nl@gmail.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-08 17:33:50 -04:00
Tianyi Zheng
8e108ed92a
Rename maths/binary_exponentiation_3.py (#9656)
* updating DIRECTORY.md

* Rename binary_exponentiation_3.py

Rename binary_exponentiation_3.py to binary_exponentiation_2.py because
the original binary_exponentiation_2.py was renamed to
binary_multiplication.py in PR #9513

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-09 08:43:07 +13:00
SubhranShu2332
e7a59bfff5
In place of calculating the factorial several times we can run a loop k times to calculate the combination (#10051)
* In place of calculating the factorial several times we can run a loop k times to calculate the combination 

for example:
5 C 3 = 5! / (3! * (5-3)! )
= (5*4*3*2*1)/[(3*2*1)*(2*1)]
=(5*4*3)/(3*2*1)
so running a loop k times will reduce the time complexity to O(k)

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

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

* Update maths/combinations.py

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-08 15:17:02 -04:00
Aarya Balwadkar
6860daea60
Made Changes shifted CRT, modular division to maths directory (#10084) 2023-10-08 11:53:38 -04:00
pre-commit-ci[bot]
895dffb412
[pre-commit.ci] pre-commit autoupdate (#9543)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292)
- [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6)
- [github.com/tox-dev/pyproject-fmt: 1.1.0 → 1.2.0](https://github.com/tox-dev/pyproject-fmt/compare/1.1.0...1.2.0)

* updating DIRECTORY.md

* Fix typos in test_min_spanning_tree_prim.py

* Fix typos

* codespell --ignore-words-list=manuel

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-07 21:32:28 +02:00
Kamil
2122474e41
Segmented sieve - doctests (#9945)
* Replacing the generator with numpy vector operations from lu_decomposition.

* Revert "Replacing the generator with numpy vector operations from lu_decomposition."

This reverts commit ad217c6616.

* Added doctests.

* Update segmented_sieve.py

Removed unnecessary check.

* Update segmented_sieve.py

Added checks for 0 and negative numbers.

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

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

* Update segmented_sieve.py

* Update segmented_sieve.py

Added float number check.

* Update segmented_sieve.py

* Update segmented_sieve.py

simplified verification

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

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

* Update segmented_sieve.py

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

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

* Update segmented_sieve.py

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

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

* ValueError: Number 22.2 must instead be a positive integer

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-07 05:09:39 -04:00
fxdup
995c5533c6
Consolidate gamma (#9769)
* refactor(gamma): Append _iterative to func name

* refactor(gamma): Consolidate implementations

* refactor(gamma): Redundant test function removal

* Update maths/gamma.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-06 14:46:58 -04:00
Muhammad Umer Farooq
cffdf99c55
Updated prime_numbers.py testcases. (#9851)
* Updated prime_numbers.py testcases.

* revert __main__ code.
2023-10-05 20:44:55 +02:00
Aasheesh
deb0480b3a
Changing the directory of sigmoid_linear_unit.py (#9824)
* Changing the directory of sigmoid_linear_unit.py

* Delete neural_network/activation_functions/__init__.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-05 10:07:44 -04:00
Kamil
9bfc314e87
hardy_ramanujanalgo type annotation (#9799)
* Replacing the generator with numpy vector operations from lu_decomposition.

* Revert "Replacing the generator with numpy vector operations from lu_decomposition."

This reverts commit ad217c6616.

* Added type annotation.
2023-10-05 08:39:29 -04:00
Abul Hasan
f159a33506
convert to the base minus 2 of a number (#9748)
* Fix: Issue 9588

* Fix: Issue 9588

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

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

* Fix: Issue 9588

* Fix: Issue #9588

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

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

* Fix: Issue #9588

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

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

* Fix: Issue #9588

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

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

* fix: issue #9793

* fix: issue #9793

* fix: issue #9588

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-05 14:39:14 +02:00
Kamil
1b6c5cc271
Karatsuba type annotation (#9800)
* Replacing the generator with numpy vector operations from lu_decomposition.

* Revert "Replacing the generator with numpy vector operations from lu_decomposition."

This reverts commit ad217c6616.

* Added type annotation.
2023-10-05 08:30:43 -04:00
Kamil
0e3ea3fbab
Fermat_little_theorem type annotation (#9794)
* Replacing the generator with numpy vector operations from lu_decomposition.

* Revert "Replacing the generator with numpy vector operations from lu_decomposition."

This reverts commit ad217c6616.

* Added type annotation.

* Update fermat_little_theorem.py

Used other syntax.

* Update fermat_little_theorem.py

* Update maths/fermat_little_theorem.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-05 07:30:39 -04:00
Tauseef Hilal Tantary
2fd43c0f7f
[New Algorithm] - Bell Numbers (#9324)
* Add Bell Numbers

* Use descriptive variable names

* Add type hints

* Fix failing tests
2023-10-05 12:33:12 +13:00
piyush-poddar
26d650ec28
Moved relu.py from maths/ to neural_network/activation_functions (#9753)
* Moved file relu.py from maths/ to neural_network/activation_functions

* Renamed relu.py to rectified_linear_unit.py

* Renamed relu.py to rectified_linear_unit.py in DIRECTORY.md
2023-10-04 16:28:19 -04:00
Aasheesh
0a84b8f842
Changing Name of file and adding doctests in file. (#9513)
* Adding doctests and changing file name

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

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

* Update binary_multiplication.py

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

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

* Update binary_multiplication.py

* Changing comment and changing name function

* Changing comment and changing name function

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

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

* Update binary_multiplication.py

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

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

* Update binary_multiplication.py

* Update binary_multiplication.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-10-03 11:40:11 -04:00
dekomori_sanae09
b60a94b5b3
merge double_factorial (#9431)
* merge double_factorial

* fix ruff error

* fix merge issues

* change test case

* fix import error
2023-10-03 09:53:27 -04:00
Christian Clauss
da03c14d39
Fix accuracy in maclaurin_series on Python 3.12 (#9581) 2023-10-03 22:48:58 +13:00
Christian Clauss
0f4e51245f
Upgrade to Python 3.12 (#9576)
* DRAFT: GitHub Actions: Test on Python 3.12

Repeats #8777
* #8777 

Some of our dependencies will not be ready yet.

* Python 3.12: Disable qiskit and tensorflow algorithms

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-03 14:47:10 +05:30
aryan1165
f8fe8fe41f
Removed maths/miller_rabin.py , Double implementation. #8098 (#9228)
* Removed ciphers/rabin_miller.py as it is already there maths/miller_rabin.py

* Renamed miller_rabin.py to rabain_miller.py

* Restore ciphers/rabin_miller.py and removed maths/rabin_miller.py
2023-10-03 10:57:00 +13:00
Saksham Chawla
95345f6f5b
Add typng to binomial_coefficient.py (#9480) 2023-10-02 11:21:45 -04:00
Saksham Chawla
73118b9f67
Add typing to binary_exponentiation_3.py (#9477) 2023-10-02 10:41:34 -04:00
Saksham Chawla
97154cfa35
Add typing to binary_exp_mod.py (#9469)
* Add typing to  binary_exp_mod.py

* Update binary_exp_mod.py

* review changes
2023-10-02 10:30:34 -04:00
Saksham Chawla
89a65a8617
Add typing to binary_exponentiation.py (#9471)
* Add typing to binary_exponentiation.py

* Update binary_exponentiation.py

* float to int division change as per review
2023-10-02 10:29:06 -04:00
Saksham Chawla
9640a4041a
Add typing to binary_exponentiation_2.py (#9475) 2023-10-02 10:28:36 -04:00
Bama Charan Chhandogi
43c3f4ea40
add Three sum (#9177)
* add Three sum

* add Three sum

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

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

* update

* update

* update

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

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

* update

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

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

* add documention

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-01 16:46:12 +02:00
aryan1165
fbbbd5db05
Deleted add.py. As stated in #6216 (#9180) 2023-10-01 01:34:03 -04:00
aryan1165
38c2b83981
Deleted euclidean_gcd.py. Fixes#8063 (#9108) 2023-09-27 15:56:01 +02:00
Tianyi Zheng
f9b8759ba8
Move bitwise add (#9097)
* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Move and rename maths/sum_of_two_positive_numbers_bitwise.py

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-09-27 15:54:40 +02:00
Okza Pradhana
b2e186f4b7
feat(maths): add function to perform calculation (#6602)
* feat(maths): add function to perform calculation
- Add single function to calculate sum of two positive numbers
  using bitwise operator

* docs: add wikipedia url as explanation

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

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

* Apply suggestions from code review

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

* Update sum_of_two_positive_numbers_bitwise.py

* Update sum_of_two_positive_numbers_bitwise.py

* Update sum_of_two_positive_numbers_bitwise.py

---------

Co-authored-by: Okza Pradhana <okzapradhana@azko-macbook.local>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2023-09-27 02:06:19 -04:00
Rohan Saraogi
0cae02451a
Added nth_sgonal_num.py (#8753)
* Added nth_sgonal_num.py

* Update and rename nth_sgonal_num.py to polygonal_numbers.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-09-07 03:52:36 -04:00
David Ekong
9e4f9962a0
Created harshad_numbers.py (#9023)
* Created harshad_numbers.py

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

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

* Update harshad_numbers.py

Fixed a few errors

* Update harshad_numbers.py

Added function type hints

* Update harshad_numbers.py

Fixed depreciated Tuple and List usage

* Update harshad_numbers.py

Fixed incompatible types in assignments

* Update harshad_numbers.py

Fixed incompatible type assignments

* Update maths/harshad_numbers.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update maths/harshad_numbers.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Raised Value Error for negative inputs

* Update maths/harshad_numbers.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update maths/harshad_numbers.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update maths/harshad_numbers.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update harshad_numbers.py

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

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

* Update harshad_numbers.py

* Update harshad_numbers.py

* Update harshad_numbers.py

* Update harshad_numbers.py

Added doc test to int_to_base, fixed nested loop, other minor changes

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-09-06 10:00:09 -04:00
pre-commit-ci[bot]
421ace81ed
[pre-commit.ci] pre-commit autoupdate (#9013)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.285 → v0.0.286](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.285...v0.0.286)
- [github.com/tox-dev/pyproject-fmt: 0.13.1 → 1.1.0](https://github.com/tox-dev/pyproject-fmt/compare/0.13.1...1.1.0)

* updating DIRECTORY.md

* Fis ruff rules PIE808,PLR1714

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-08-29 15:18:10 +02:00
Guduly
672e7bde2e
Update arc_length.py (#8964)
* Update arc_length.py

Wrote the output of testcase

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

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

* Update arc_length.py

Added the requested changes

* Update arc_length.py

followed the change request

* Update arc_length.py

followed suggestions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-20 16:39:29 -07:00
Tianyi Zheng
e887c14f12
Fix continued_fraction.py to work for negative numbers (#8985)
* Add doctests to continued_fraction.py for 0 and neg nums

* Fix continued_fraction.py to work for negative nums

Fix continued_fraction.py to work for negative nums by replacing int() call with floor()

* Move comment in doctest
2023-08-18 16:53:17 -04:00