Compute the minimum or maximum of two integers without branching | Function to find minimum of x and y ; Function to find maximum of x and y ; Driver Code
< ? php function m_in ( $ x , $ y ) { return $ y ^ ( ( $ x ^ $ y ) & - ( $ x < $ y ) ) ; } function m_ax ( $ x , $ y ) { return $ x ^ ( ( $ x ^ $ y ) & - ( $ x < $ y ) ) ; } $ x = 15 ; $ y = 6 ; echo " Minimum ▁ of " , " ▁ " , $ x , " ▁ " , " and " , " ▁ " , $ y , " ▁ " , " ▁ is ▁ " , " ▁ " ; echo m_in ( $ x , $ y ) ; echo " Maximum of " , " " , $ x , " " , STRNEWLINE TABSYMBOL " and " , " " , $ y , " " , ▁ " is " echo m_ax ( $ x , $ y ) ; ? >