![]() |
I found a problem with Python - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: I found a problem with Python (/thread-40378.html) Pages:
1
2
|
I found a problem with Python - Lahearle - Jul-19-2023 So I read that Python no longer uses long conversions and all are longs with an "int" format I found an odd problem reading these forums, it's as goes: find if A is == to e**0.2: a = 27 b = 84 c = 110 d = 133 e = (int(a**5 + b**5 + c**5 + d**5)) Z = (int(e**0.2)) #####print(e, a ,b)##### avoid due to it incrementing stacks if Z == a**5: print("yes") print(a**5) #for checking the value anyway if Z != a**5: print("no") print(a**5) print(Z) print(e) This will print NO because the SUMMATION of e in Z becomes rounded to 144 SHORT. But we can still see that by printing A**5 it converts it into a long. I think this is because when the values of e are exchanged to Z it forces it into a short. I would convert to a long but those are not available. I tried Int Z, tried adding 000000000000000000 to first of e(dumb probably). Just tried: if e**0.2 == a**5: and it is still no. This telling me it comes from the problem e**0.2 converting it into short most likely. plz fix RE: I found a problem with Python - deanhystad - Jul-19-2023 I don't get what you are trying to show. Why would a**5 == e**0.2? When does 14,348,907 (a**5) equal 144 (e**0.2)? RE: I found a problem with Python - Pedroski55 - Jul-20-2023 If a = 27, and Z = e**0.2, even I, a complete non-mathematician, can see that a**5 will never equal Z! What are you thinking? Look here for Python number types. Maybe you want something like this. Try each line in your Python shell: import math euler = math.e type(euler) Z = euler**0.2 print('e**0.2 =', Z) mylist = [27, 84, 110, 133] for m in range(0, len(mylist) - 1): num = mylist[m+1] / mylist[m] print('numerator is', mylist[m+1], 'divisor is', mylist[m], 'result of division is', num ) if int(num) == int(Z): print('The integer of e**0.2 is equal to the integer of', num) RE: I found a problem with Python - Lahearle - Jul-20-2023 Alright noobs well become a mathematician first. a = 27^5 (14348907) e = 27^5 + 84^5 + 110^5 + 133^5 (61917364224) therefor what is 1/5th of 61917364224 = 12383472844.8 But e is 61917364224^1/5th it's number it's checking to see if a (14348907) is 1/5th of e RE: I found a problem with Python - Lahearle - Jul-20-2023 Pro tip 1^1 is is 1x1 = 1 1 ^ 0.2 is = 0.2 RE: I found a problem with Python - Lahearle - Jul-20-2023 ps google is wrong RE: I found a problem with Python - Lahearle - Jul-20-2023 1**0.2 also shows up as 1 kek. seems it's rounding to the nearest whole number that is not 0. Which brings me to the the concept of 144 not being anywhere close to e**0.2 I'm fairly sure what's happening is e is actually zero as it's pulled so it just pulls a**5 instead and so e just = a and a**0.2 turns into a decimal and rounds to 144 instead of 14348907 just a thought. Also I don't know anything about power amplification but do you guys think this chart would be good for power amps? 27^5 + 84^5 + 110^5 + 133^5x^0.2 which is like P(Power)==Wattage^Resistance (kek im a wizard) RE: I found a problem with Python - Lahearle - Jul-20-2023 Also P vs NP solution is false Suduko has 1 - 10 which is a set amount of numbers to search through Normal exponents have to search for infinite amounts of numbers, the longer the slower. So while the actual method of times is essentially the same, though exponents take larger steps than polynomials, there is no way to guess evidence that is not there quicker. The reason the solution solving the problem faster is because if I'm going A-Z and I know Z I can acommodate every other letter to add up to Z but if I don't have Z I have no idea what I'm looking for and the answer is always going to be random if I'm adding random numbers. kek In other words They are the same, but the problem proposed in P vs NP is false. You will not find info that is not there based on mathematics. Sorry chumps but the Syntax has to be correct or you will not have a real problem. Therefor you will never become infinitely intelligent noob. (I know that's what you want) RE: I found a problem with Python - Lahearle - Jul-20-2023 Also if you set X^5 + B^5 + C^5x^anything but one it will full loop and become infinite. RE: I found a problem with Python - Pedroski55 - Jul-20-2023 Ah, pick another letter, not e for Euler's number! Is this what you expect? mylist = [27, 84, 110, 133] e = 0 for num in mylist: e = e + num**5 print('e is', e) print('e**0.2 is', e**0.2) Z = e**0.2 print('Z is', Z) if Z == e**0.2: print('e**0.2 and Z are the same!')
|