Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:10 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Problem with MM+ matematics

     Page 2 of 2    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 09:31am 14 Dec 2015
Copy link to clipboard 
Print this post

It doesn't fit in a 64-bit integer, whose max is around
18,446,744,073,709,551,615 (2^64-1, using unsigned)

i.e. about 1E19

At a guess the value you posted is the bottom 64 or 63 bits of the correct number (i.e. mod 64-bits).

JohnEdited by JohnS 2015-12-15
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:33am 14 Dec 2015
Copy link to clipboard 
Print this post

(7^7)^7 = 2.5692357752105887808861147722424e+41

7^(7^7) = 823543

7^7^7 without brackets causes as much discussion as the Paris Climate Change meeting without any consensus.

Most calculators work from left to right so will give the first answer.
A lot of programming languages will resolve power from right to left resulting in the second answer.

Jim

VK7JH
MMedit
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 09:35am 14 Dec 2015
Copy link to clipboard 
Print this post

Jim,

Something wrong with your calculation of that 2nd one!!

7^7 = 823543

I can post the correct value if anyone wants a BIG post (695975 digits)...

E.g. it's the output from
echo '7^(7^7)' | bc
its length is
echo '7^(7^7)' | bc | tr -c -d '[0-9]' | wc -c

(which grabs just the digits and counts them)

JohnEdited by JohnS 2015-12-15
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:53am 14 Dec 2015
Copy link to clipboard 
Print this post

You are right.
Excel correctly gives an error for 7^(7^7) but MS calculator gave 823543.

Excel and VB also differ in the order they treat Power operators.

Negative numbers also suffer from the lack of a clear order.

-2^2 can be treated as (-2)^2 = 4 or -(2^2) = -4

Jim
VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 09:56am 14 Dec 2015
Copy link to clipboard 
Print this post

BTW, what is a "matematic"? (see title of thread)
Smoke makes things work. When the smoke gets out, it stops!
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 09:58am 14 Dec 2015
Copy link to clipboard 
Print this post

Each programming language should (as far as I know: always does) define the order.

But it's wise to use parentheses :)

John
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 10:15am 14 Dec 2015
Copy link to clipboard 
Print this post

  Grogster said   BTW, what is a "matematic"? (see title of thread)


Hey, that was uncalled for
A small typo on top of my secondary English... But still goes well as "science for mates"
http://rittle.org

--------------
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 10:21am 14 Dec 2015
Copy link to clipboard 
Print this post

  kiiid said  
  Grogster said   BTW, what is a "matematic"? (see title of thread)


Hey, that was uncalled for
A small typo on top of my secondary English... But still goes well as "science for mates"


'Floating' spelling!

Just out of interest; PRINT 7^(7^7) generates -3,568,518,334,133,427,593

Don't think we've seen that number mentioned here yet!
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 09:26pm 14 Dec 2015
Copy link to clipboard 
Print this post

I tried the equivalent in electride, eg

a = 7.0 ** ( 7.0 ** 7.0 )
or
a = 7 ** ( 7 ** 7 )
etc

floating point ( single and double ) return "+Inf" which
is microchips positive-infinite symbol.

integer (32 bit) returns a large integer which I guess is
the remainder 32 bits.

ed - that should be "mithimetecs" which is used for
counting sheep in NZ Edited by chronic 2015-12-16
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 11:00pm 14 Dec 2015
Copy link to clipboard 
Print this post

  kiiid said  
  Grogster said   BTW, what is a "matematic"? (see title of thread)


Hey, that was uncalled for
A small typo on top of my secondary English... But still goes well as "science for mates"


No offence, kiiid. I was just poking fun at the typo is all.
Smoke makes things work. When the smoke gets out, it stops!
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025