Skip to content
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

Closed
pirapira opened this issue Mar 3, 2017 · 6 comments
Closed

Specify zero-th power of zero #257

pirapira opened this issue Mar 3, 2017 · 6 comments
Assignees

Comments

@pirapira
Copy link
Member

pirapira commented Mar 3, 2017

0 ^ 0 might be zero or one. So, the specification of EXP needs to decide the result of EXP on two zeros.

@efaysal
Copy link

efaysal commented Mar 22, 2017

It looks as indeterminate. However doing some Mathematics,
it turns to be well definite with a real value which is 1.

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.
Now it's better to assess if this Mathematical fact is the most suitable to be coded into the software, EVM, for instance.

@chriseth
Copy link
Contributor

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 :-)

@efaysal
Copy link

efaysal commented Mar 22, 2017

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 ...

@efaysal
Copy link

efaysal commented Mar 22, 2017

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.

@axic
Copy link
Member

axic commented Mar 23, 2017

From a practical standpoint, both Solidity's internal constant evaluator and ethereumjs-vm (remix) consider it as 1.

pirapira added a commit to pirapira/yellowpaper that referenced this issue Mar 23, 2017
@axic
Copy link
Member

axic commented Mar 23, 2017

@winsvega can you add a test to the official suite for EXP(0,0) == 1?

@pirapira pirapira self-assigned this Mar 24, 2017
pirapira added a commit to pirapira/yellowpaper that referenced this issue Apr 25, 2017
pirapira added a commit to pirapira/yellowpaper that referenced this issue Jan 31, 2018
pirapira added a commit to pirapira/yellowpaper that referenced this issue Jan 31, 2018
pirapira added a commit to pirapira/yellowpaper that referenced this issue Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants