chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


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.)
My website
I am SimPlaysGames

[+] 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 Valkyrie.)

[+] 1 user Likes Valkyrie's post
Reply






Users browsing this thread: 1 Guest(s)