Program to compare m ^ n and n ^ m | Python3 program to compare which is greater m ^ n or n ^ m ; function to compare m ^ n and n ^ m ; m ^ n ; n ^ m ; Driver Code ; function call to compare m ^ n and n ^ m
import math NEW_LINE def check ( m , n ) : NEW_LINE INDENT RHS = m * math . log ( n ) ; NEW_LINE LHS = n * math . log ( m ) ; NEW_LINE if ( LHS > RHS ) : NEW_LINE INDENT print ( " m ^ n ▁ > ▁ n ^ m " ) ; NEW_LINE DEDENT elif ( LHS < RHS ) : NEW_LINE INDENT print ( " m ^ n ▁ < ▁ n ^ m " ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( " m ^ n ▁ = ▁ n ^ m " ) ; NEW_LINE DEDENT DEDENT m = 987654321 ; NEW_LINE n = 123456987 ; NEW_LINE check ( m , n ) ; NEW_LINE