Raise to the power in shell
I would try the calculator bc. See http://www.basicallytech.com/blog/index.php?/archives/23-command-line-calculations-using-bc.html for more details and examples. eg. $ echo ‘6^6’ | bc Gives 6 to the power 6.
I would try the calculator bc. See http://www.basicallytech.com/blog/index.php?/archives/23-command-line-calculations-using-bc.html for more details and examples. eg. $ echo ‘6^6’ | bc Gives 6 to the power 6.
O(10^N): trying to break a password by testing every possible combination (assuming numerical password of length N) p.s. why is your last example is of complexity O(infinity) ? it’s linear search O(N) .. there are less than 7 billion people in the world.
I guess your problem occurs because some NumPy functions explicitly require float-type arguments. Your code np.exp(test), however, has type int. Try forcing it to be float import numpy as np your_array = your_array.astype(float) output = np.exp(your_array) # OR def exp_test(x) x.astype(float) return np.exp(x) output = exp_test(your_array)
n! eventually grows faster than an exponential with a constant base (2^n and e^n), but n^n grows faster than n! since the base grows as n increases.