After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581289 - Large chained exponentials give invalid results
Large chained exponentials give invalid results
Status: RESOLVED DUPLICATE of bug 611970
Product: gnome-calculator
Classification: Core
Component: general
5.26.x
Other All
: Normal normal
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-04 10:33 UTC by Jesse Crayston
Modified: 2010-04-09 01:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Jesse Crayston 2009-05-04 10:33:00 UTC
Please describe the problem:
Integers with an exponent that is very long give the wrong answer. The answer tends to be 1 unless the integer is x^(x^(x^(x^(x^x)))) or some variation of that for greater integers where (x^(x^(x^(x^x)))) is very big. When it isn't 1 it has a pattern for integers that are the same eg.

Steps to reproduce:
1. 6^(6^(6^6))
2. 6^(6^(6^(6^6)))
3. 6^(6^(6^(6^(6^6))))
4. 6^(6^(6^(6^(6^(6^6)))))
5. 6^(6^(6^(6^(6^(6^(6^6))))))

Actual results:
1. 1  =  6^0
2. 6  =  6^1
3. 46656  = 6^6
4. 2.659119772e+36305  =  6^46656
5. 1  =  6^0

Expected results:
I was hoping for Knuth's up-arrow notation but expecting an overflow error or crashing.

Does this happen every time?
I've tried the pattern from 2 to 11 and variations of odd/even numbers which isn't a very wide range but I don't know how to use gcalc from bash.

Other information:
Comment 1 Jesse Crayston 2009-05-04 10:37:34 UTC
Oh, ignore the pattern part, I guess I'm an idiot/tired. 
Comment 2 Robert Ancell 2009-05-12 23:45:23 UTC
Confirming, depending on how you write the equations it gives different results:
6^6^6^6= -> 1
6^6=^6=^6= -> 1.204120868e+168
Comment 3 Robert Ancell 2010-04-09 01:38:12 UTC

*** This bug has been marked as a duplicate of bug 611970 ***