Login Register






Need help with simple python math filter_list
Author
Message
Need help with simple python math #1
How am I getting two different results? I'm wanting to know what 2^3^4 is for practice. But I'm getting two different answers.

http://imgur.com/a/1qpLQ

Reply

RE: Need help with simple python math #2
2^3^4 = 2^81 = 2.417852×10^24
(2^3)^4 = 2^3*4 = 2^12 = 4096

The two things are widely different, that's why you get different answers

Got me @FurryRock
(This post was last modified: 02-01-2017, 12:45 PM by Sikom.)

[+] 1 user Likes Sikom's post
Reply

RE: Need help with simple python math #3
(02-01-2017, 12:39 PM)SimPlaysGames Wrote: 2^3^4 = 2^81 = 2.417852×10^24
(2^3)^4 = 2^3*4 = 2^12 = 4096

The two things are widely different, that's why you get different answers

Got me @FurryRock

Man I need to go back to 9th grade, it looks like with knowledge of PEMDAS that the first equation would be:
2^3^4
8^4
4096

But apparently you need to solve 3^4 first, yeah I need to go back to school. Thanks tho. Smile

Reply

RE: Need help with simple python math #4
Damn simplaygames is coming up in he world!!! good job bud Cool
˙˙˙ɹǝɥʇouɐ uᴉ sǝʌᴉl ƃuᴉʌɐs 'pɐǝɹɥʇ ǝuo uᴉ ƃuᴉlloɹ┴

Reply

RE: Need help with simple python math #5
It seems your problem is already resolved, but I would recommend using the builtin pow() method. It's implemented in C (in Python 3, anyway), so it executes faster than the double star (**) operator in any case I can recall, and it tends to be far less confusing in big equations if you're familiar with Python's syntax.

Code:
>>> (2**3)**4 4096 >>> pow(pow(2,3),4) 4096
(This post was last modified: 02-01-2017, 09:37 PM by Inori.)
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

[+] 1 user Likes Inori's post
Reply