Position of rightmost different bit | Java implementation to find the position of rightmost different bit in two number . ; function to find rightmost different bit in two numbers . ; Driver code
import java . util . * ; class GFG { static int posOfRightMostDiffBit ( int m , int n ) { return ( int ) Math . floor ( Math . log10 ( Math . pow ( m ^ n , 2 ) ) ) + 2 ; } public static void main ( String [ ] args ) { int m = 52 , n = 4 ; System . out . println ( " Position ▁ = ▁ " + posOfRightMostDiffBit ( m , n ) ) ; } }