tubeshowcase●1,114,647 videos♡ My collection 0
← Learn to Code

Learn to Code09:47

Efficient Exponentiation

mCoding ↗

From the creator

How many multiplys does it take to compute x^n? It may be fewer than you think! Worried that calling x ** 15 "slow" is not correct? Don't worry, I tested! In[4]: timeit.timeit("100000 ** 15") Out[4]: 0.3686526000000043 In[5]: timeit.timeit("pow_15_minimal(100000)", globals=globals()) Out[5]: 0.3275107000000048 ― mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode Project Euler: https://projecteuler.net/problem=122 Addition Chains: https://graal.ens-lyon.fr/~yrobert/algo/additionchains1.pdf Compiler Explorer: https://godbolt.org/z/qeG1e3jdP SUPPORT ME ⭐ --------------------------------------------------- Patreon: https://patreon.com/mCoding Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Other donations: https://mcoding.io/donate BE ACTIVE IN MY COMMUNITY 😄 --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcoding

Published 2021-05-01 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code