10-07-2024, 09:21 PM
(This post was last modified: 10-07-2024, 09:24 PM by Kernelpanic.)
When I wanted to try something today, I came across a problem, at least for me.
The results do not match what the MS calculator and online calculators give. I am also confused by the fact that ((5 ^ 4)^4) is not the same as 5^(4*4) for the program, but 5^16 gives a result like ((5 ^ 4)^4). Have I there disregarded some mathematical laws?
Math-Solver
The results do not match what the MS calculator and online calculators give. I am also confused by the fact that ((5 ^ 4)^4) is not the same as 5^(4*4) for the program, but 5^16 gives a result like ((5 ^ 4)^4). Have I there disregarded some mathematical laws?
Code: (Select All)
'Matheuebung Potenzen hoch Potenzen - 7. Okt. 2024
Option _Explicit
Dim As Integer a, b, c
Dim As _Unsigned Long sum, sum2, sum3
Locate 2, 3
Print "Berechnet ((a ^ b) ^ c)"
Locate 3, 3
Print "======================="
'Beispiel: ((5^4)^4) = 5^16
'MS-Rechner: 152.587.890.625 -- Hier: 2.264.035.265
Locate 5, 3
Input "a: ", a
Locate 6, 3
Input "b: ", b
Locate 7, 3
Input "c: ", c
sum = ((a ^ b) ^ c)
Locate 9, 3
Print Using "Summe 1: ###,##########"; sum
sum2 = a ^ (a * b)
Locate 11, 3
Print Using "Summe 2: ###,##########"; sum2
sum3 = a ^ 16
Locate 13, 3
Print Using "Summe 3: ###,##########"; sum3
End
Math-Solver