Skip to content

maths/binary_exponentiation_2.py needs to be renamed #9478

Closed
@tianyizheng02

Description

@tianyizheng02

Repository commit

ef8df14

Python version (python --version)

Python 3.11.5

Dependencies version (pip freeze)

Dependency versions
beautifulsoup4==4.12.2
black==23.3.0
bs4==0.0.1
certifi==2023.5.7
cffi==1.15.1
cfgv==3.3.1
charset-normalizer==3.1.0
click==8.1.3
contourpy==1.1.0
cryptography==41.0.1
cycler==0.11.0
dill==0.3.6
distlib==0.3.6
fake-useragent==1.2.1
filelock==3.12.2
fonttools==4.40.0
identify==2.5.24
idna==3.4
joblib==1.3.1
kiwisolver==1.4.4
lxml-stubs==0.4.0
matplotlib==3.7.1
mpmath==1.3.0
mypy==1.4.0
mypy-extensions==1.0.0
networkx==3.1
nodeenv==1.8.0
ntlm-auth==1.5.0
numpy==1.26.0
packaging==23.1
pandas==2.0.3
pandas-stubs==2.1.1.230928
pathspec==0.11.1
pbr==5.11.1
Pillow==9.5.0
pip==23.2.1
platformdirs==3.8.0
ply==3.11
pre-commit==3.3.3
projectq==0.8.0
psutil==5.9.5
pycparser==2.21
pyparsing==3.1.0
python-dateutil==2.8.2
pytz==2023.3
PyYAML==6.0
qiskit==0.43.1
qiskit-aer==0.12.0
qiskit-ibmq-provider==0.20.2
qiskit-terra==0.24.1
requests==2.31.0
requests-ntlm==1.1.0
ruff==0.0.275
rustworkx==0.13.0
scikit-learn==1.2.2
scipy==1.10.1
seaborn==0.12.2
setuptools==68.0.0
six==1.16.0
soupsieve==2.4.1
stevedore==5.1.0
symengine==0.9.2
sympy==1.12
threadpoolctl==3.1.0
types-beautifulsoup4==4.12.0.6
types-html5lib==1.1.11.15
types-Pillow==10.0.0.3
types-pytz==2023.3.1.1
types-requests==2.31.0.1
types-urllib3==1.26.25.13
typing_extensions==4.6.3
tzdata==2023.3
urllib3==2.0.3
virtualenv==20.23.1
websocket-client==1.6.1
websockets==11.0.3
wheel==0.40.0

Expected behavior

The file calculates exponentiation, a ** b.

Actual behavior

The file calculates multiplication, a * b.

>>> import maths.binary_exponentiation_2 as binexp
>>> binexp.b_expo(2, 3)
6

This file should be renamed to binary_multiplication.py. Also, we need doctests in this file so that basic errors like this can be caught.

Hacktoberfest contributors: Do not ask to work on this issue. If you want to work on it, just open a PR. Read the contributing guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions