Good code is its own best documentation. As you're about to add a comment, ask yourself, 'How can I improve the code so that this comment isn't needed?' Improve the code and then document it to make it even clearer. Steve McConnell
Find the maximum of two numbers without using if-else or any comparison operator. This algorithm gets the maximum value from two numbers without using any comparison operator and if else condition. Example:- Given 23 and 45. Returns 45
Max value from 23 and 45 is : 45
Comments
March 23, 2016 10:25 am
Especially for Java integers, the expression ( (c >> 31) & 0x1 ) could be simplified: (c >>> 31)