+ 2

I am a beginner . so how to write exponential in python

8th Aug 2018, 5:24 PM
Antonio Nevil
Antonio Nevil - avatar
10 Respuestas
+ 7
Exponentiation operator uses a double asterisk: 2**5 == 32 0**1 == 0 0**0 == 1
8th Aug 2018, 6:31 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 7
Yes, it depends on implementation of the exponentiation operator - which rule fires off first - 0**x == 0 or x**0 == 1 :) Other languages might have other results.
8th Aug 2018, 6:54 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
8th Aug 2018, 7:28 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Angelo B. You are right, there is no universally accepted definition for 0**0. Kuba summed up the reason succinctly: while "anything" to the power of zero is 1, zero to the power of "anything" is zero. However, it is sometimes defined as 1 in some branches of mathematics (like algebra, set theory, and combinatorics) for the sake of convenience. You can read more at https://en.m.wikipedia.org/wiki/Zero_to_the_power_of_zero
9th Aug 2018, 3:52 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 2
Thanks to all but, if you try in programming languages 0/0, that is an indeterminate form, the result is an error or NAN. I think the result =1 only for convention, infact all calculators give 1 as result, but strictly math speaking, this is not the true
8th Aug 2018, 7:44 PM
RoboCybernetic
RoboCybernetic - avatar
+ 1
In math 0**0 Is indefinite form, not 1. Strange result
8th Aug 2018, 6:42 PM
RoboCybernetic
RoboCybernetic - avatar
+ 1
iirc anything to the power of 0 is 1, and 0 itself isn't exempt from this. kinda like how 0! is 1, it just works. Angelo B.
8th Aug 2018, 9:56 PM
hinanawi
hinanawi - avatar
0
maybe using numpy the result is correct.
8th Aug 2018, 7:18 PM
RoboCybernetic
RoboCybernetic - avatar
8th Aug 2018, 8:03 PM
RoboCybernetic
RoboCybernetic - avatar
- 3
angelo B. 0**0 is 1 becase 0**0 means nothing at all but there must be something.so it becomes 1*0**0 which is 1
8th Aug 2018, 7:30 PM
pixelman
pixelman - avatar