mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 12:16:14 -04:00
Update binary_exponentiation.py
This commit is contained in:
parent
d61684057c
commit
e1e46e59c8
@ -2,11 +2,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# author: bt3gl
|
||||
|
||||
```
|
||||
'''
|
||||
Binary exponentiation, also known as exponentiation by squaring, is a technique for
|
||||
efficiently computing the power of a number. By repeatedly squaring x and halving n,
|
||||
we can quickly compute x^n using a logarithmic number of multiplications.
|
||||
````
|
||||
'''
|
||||
|
||||
def binary_exp(x: float, n: int) -> float:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user