Click here to Skip to main content
15,884,838 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralLearning to live without if() statements Pin
honey the codewitch7-Jan-21 11:07
mvahoney the codewitch7-Jan-21 11:07 
GeneralRe: Learning to live without if() statements Pin
PIEBALDconsult7-Jan-21 11:28
mvePIEBALDconsult7-Jan-21 11:28 
GeneralRe: Learning to live without if() statements Pin
honey the codewitch7-Jan-21 11:34
mvahoney the codewitch7-Jan-21 11:34 
GeneralRe: Learning to live without if() statements Pin
trønderen7-Jan-21 11:44
trønderen7-Jan-21 11:44 
GeneralRe: Learning to live without if() statements Pin
Peter_in_27807-Jan-21 14:47
professionalPeter_in_27807-Jan-21 14:47 
GeneralRe: Learning to live without if() statements Pin
Chris C-B7-Jan-21 19:43
Chris C-B7-Jan-21 19:43 
GeneralRe: Learning to live without if() statements Pin
honey the codewitch8-Jan-21 3:00
mvahoney the codewitch8-Jan-21 3:00 
GeneralRe: Learning to live without if() statements Pin
CPallini7-Jan-21 20:10
mveCPallini7-Jan-21 20:10 
C++
// returns whichever is greatest
int max(int x, int y) {
      return x*(x>y)+y*(x<=y);
}




      |                |
      |  OPTIMIZATION  |
      |  OPTIMIZATION  |
      |  OPTIMIZATION  |
      |  OPTIMIZATION  |
      |  OPTIMIZATION  |
      |  OPTIMIZATION  |
   ----                ----
   \                      /
    \                    /
     \                  /
      \                /
       \              /
        \            /
         \          /
          \        /
           \      /
            \    /
             \  /
              \/






// returns whichever is greatest
int max(int x, int y)
{
  if (x > y)
    return x;
  return y;
}

Laugh | :laugh:
"In testa che avete, Signor di Ceprano?"
-- Rigoletto

GeneralRe: Learning to live without if() statements Pin
honey the codewitch8-Jan-21 1:53
mvahoney the codewitch8-Jan-21 1:53 
GeneralRe: Learning to live without if() statements Pin
Shao Voon Wong8-Jan-21 0:45
mvaShao Voon Wong8-Jan-21 0:45 
GeneralRe: Learning to live without if() statements Pin
honey the codewitch8-Jan-21 1:53
mvahoney the codewitch8-Jan-21 1:53 
GeneralRe: Learning to live without if() statements Pin
obermd8-Jan-21 3:31
obermd8-Jan-21 3:31 
GeneralRe: Learning to live without if() statements Pin
honey the codewitch8-Jan-21 4:03
mvahoney the codewitch8-Jan-21 4:03 
GeneralRe: Learning to live without if() statements Pin
BillWoodruff9-Jan-21 3:01
professionalBillWoodruff9-Jan-21 3:01 
GeneralRe: Learning to live without if() statements Pin
honey the codewitch9-Jan-21 3:16
mvahoney the codewitch9-Jan-21 3:16 
GeneralRe: Learning to live without if() statements Pin
BillWoodruff9-Jan-21 6:12
professionalBillWoodruff9-Jan-21 6:12 
GeneralRe: Learning to live without if() statements Pin
honey the codewitch9-Jan-21 6:20
mvahoney the codewitch9-Jan-21 6:20 
GeneralAmazing luck Pin
Cp-Coder7-Jan-21 10:07
Cp-Coder7-Jan-21 10:07 
GeneralRe: Amazing luck Pin
OriginalGriff7-Jan-21 10:59
mveOriginalGriff7-Jan-21 10:59 
GeneralRe: Amazing luck Pin
honey the codewitch7-Jan-21 11:20
mvahoney the codewitch7-Jan-21 11:20 
GeneralRe: Amazing luck Pin
#realJSOP7-Jan-21 11:29
mve#realJSOP7-Jan-21 11:29 
PraiseRe: Amazing luck Pin
Gary R. Wheeler7-Jan-21 15:18
Gary R. Wheeler7-Jan-21 15:18 
GeneralRe: Amazing luck Pin
GenJerDan8-Jan-21 0:14
GenJerDan8-Jan-21 0:14 
GeneralRe: Amazing luck Pin
Jörgen Andersson8-Jan-21 2:15
professionalJörgen Andersson8-Jan-21 2:15 
GeneralRe: Amazing luck Pin
Cp-Coder8-Jan-21 2:55
Cp-Coder8-Jan-21 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.