-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify zero-th power of zero #257
Comments
It looks as indeterminate. However doing some Mathematics, lim x^x when x --> 0 is equivalent to lim exp(xlog(x)) when x --> 0. As lim xlog(x) when x -->0, is 0. This is a known Mathematical fact not a convention! lim x^x when x --> 0 is simply exp(0) = 1. 0 ^ 0 better to be evaluated as 1. If you decide that 0 ^ 0=1, Mathematics are supporting you totally. |
You are giving an analytical explanation for an algebraic question. Note that the EVM does not know whether there is anything between 0 and 1 :-) |
I'm aware about that situation, that's why I finished my text with: Now it's better to assess if this Mathematical fact is the most suitable to be coded into the software, EVM, for instance. Most numerical software use the fact that 0^0 =1 , using 0^0 =0 instead of, will be a surprising convention ... hopefully it will not be exploited for any thing weird ... |
FYI: 0^0 is still almost always defined as 1, as mandated by the IEEE 754 floating point standard. You can go with the convention using 0^0 =0, if you think that will change the world of floating point standard. |
From a practical standpoint, both Solidity's internal constant evaluator and ethereumjs-vm (remix) consider it as 1. |
@winsvega can you add a test to the official suite for |
0 ^ 0
might be zero or one. So, the specification ofEXP
needs to decide the result ofEXP
on two zeros.The text was updated successfully, but these errors were encountered: