[Question]
  [
You have two values each of which is either `0` representing "unknown", or one of `1,2,3`. Merge them into a single value as follows:
* If both values are nonzero and equal, output that value:  
`(3,3) -> 3`
* If both values are nonzero but unequal, output 0 for unknown:  
`(1,2) -> 0`
* If one value is zero and the other is not, output the nonzero value:  
`(2,0) -> 2, (0,1) -> 1`
* If both values are zero, output zero:  
`(0,0) -> 0`
**Test cases:**
There are 16 possible input pairs.
```
  | 0 1 2 3
--+--------
0 | 0 1 2 3
1 | 1 1 0 0
2 | 2 0 2 0
3 | 3 0 0 3
(0, 0) -> 0
(0, 1) -> 1
(0, 2) -> 2
(0, 3) -> 3
(1, 0) -> 1
(1, 1) -> 1
(1, 2) -> 0
(1, 3) -> 0
(2, 0) -> 2
(2, 1) -> 0
(2, 2) -> 2
(2, 3) -> 0
(3, 0) -> 3
(3, 1) -> 0
(3, 2) -> 0
(3, 3) -> 3
```
## Leaderboards
```
var QUESTION_ID=165314,OVERRIDE_USER=8478;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
# [Python 3](https://docs.python.org/3/), ~~27~~ 25 bytes
```
lambda x,y:(x|y)>>(x*y&2)
```
[Try it online!](https://tio.run/##K6gsycjPM/6fpmCrEPM/JzE3KSVRoUKn0kqjoqZS085Oo0KrUs1I839afpFChUJmnkJRYl56qoaJphUXJ0isEk2Ms6AoM69EI02jQkehUlNHITUvxVZdQV2TCyqh@R8A "Python 3 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 4 bytes
```
gf|S
```
[Try it online!](https://tio.run/##y0rNyan8/z89rSb4v8nDHdsOLz@8L8H9PwA "Jelly – Try It Online")
### How it works
```
gf|S  Main link. Left argument: x. Right argument: y.
g     Compute a, the gcd of x and y.
  |   Compute b, the bitwise OR of x and y.
 f    Filter; yield all common elements of [a] and [b].
   S  Take the sum.
```
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 5 bytes
```
⌈×∧=⌊
```
[Try it online!](https://tio.run/##AS0A0v9hcGwtZHlhbG9n//9m4oaQ4oyIw5fiiKc94oyK///iiJguZuKNqDAgMSAyIDM "APL (Dyalog) – Try It Online")
Useful [reference](https://codegolf.stackexchange.com/a/151368/71256)
`∧=⌊`: Returns `1` if the lowest common multiple is equal to the minimum. This is only true if one of the values is zero, or both are equal. Alternatively I could have `=*⌊`
`⌈×`: The maximum multiplied by the above.
[Answer]
# [Shakespeare Programming Language](http://shakespearelang.sourceforge.net/report/shakespeare/), 296 bytes
```
Z.Ford,.Ajax,.Act I:.Scene I:.[Enter Ford and Ajax]Ajax:Listen to thy heart.Ford:Listen to thy heart.Am I as fat as you?Ajax:If so,let us Scene C.Am I as fat as zero?If so,let us Scene C.Ford:Am I as fat as zero?If not,you zero.open heart.let us Scene V.Scene C:.Ajax:open heart.Scene V:.[Exeunt]
```
[Try it online!](https://tio.run/##dZDPCoMwDMbve4o8gJTBbr2IyAbCbgMPGx6KRtxwjbQp6F6@s9XDNtwlf8iP70tih977qziRaRKRPdQ4x5qhkOJSo8ZQ3I6a0UBAQOkGAlWFIM93y6iBCbiboENlOCptDrInFKAstIpDmsilUaRowVLSI4OzsJjmv/ALDaWbYLT7Q2viZLaJvaBhXmjZ5EuiXA/NZTxffnArED4wotNceX/Y7d8)
First participation to a code-golf challenge, so let's start with one of my favorite joke languages !
Explanation :
Declaration of the two variables Ford and Ajax (shortest variable names available)
```
Z.Ford,.Ajax,.
```
First Scene : Put the two values into the variable, then test them for equality, then test Ajax against 0. If the value that we have to return is stored in the variable Ford, go to Scene C.
```
Act I:.
Scene I:.
[Enter Ford and Ajax]
Ajax:
Listen to thy heart.
Ford:Listen to thy heart.
Am I as fat as you?
Ajax:
If so,let us Scene C.
Am I as fat as zero?
If so,let us Scene C.
```
If Ford is 0, print Ajax, else set Ajax as 0 then print Ajax. Then go to the end of the program.
```
Ford:Am I as fat as zero?
If not,you zero.
open heart.
let us Scene V.
```
Scene C : Print Ford
```
Scene C:.
Ajax:open heart.
```
Scene V: End of the program.
```
Scene V:.
[Exeunt]
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 21 bytes
```
->a,b{(a|b)*531[a*b]}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y5RJ6laI7EmSVPL1NgwOlErKbb2f0FpSbGChoGenrGmXm5iQXVNYg0yL6kmLRqoLbZWS11BvfY/AA "Ruby – Try It Online")
Because Ruby
# Short explanation:
* `a|b` is bitwse OR, so it gives us the right number if a==b or one of them is zero.
* Magic number `531` is 2^9+2^4+2^1+2^0, and the [] operator extracts a single bit. This means: multiply by 1 if a\*b is 0, 1, 2, 4 or 9, multiply by 0 otherwise.
* This won't work for values > 3
[Answer]
# [Haskell](https://www.haskell.org/), 25 bytes
```
x!y=0^((x-y)^2*x)*y+0^y*x
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/v0Kx0tYgTkOjQrdSM85Iq0JTq1LbIK5Sq@J/bmJmnoKtQko@l4JCbmKBb7xCQVFmXolCdDRQj0KNQoWCja5CtIGennFsLJBbicT9DwA "Haskell – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~8~~ 7 bytes
```
@{+0SQ3
```
[Try it online!](https://pyth.herokuapp.com/?code=%40%7B%2B0SQ3&test_suite=1&test_suite_input=%5B3%2C3%5D%0A%5B1%2C2%5D%0A%5B1%2C0%5D%0A%5B0%2C1%5D%0A%5B0%2C0%5D&debug=0)
```
@{+0SQ3   Implicit: Q=input()
    SQ    Sort input
  +0      Prepend 0
 {        Deduplicate
@     3    Get 4th element (index 3), modular indexing
```
**Case 1 - Both values nonzero and equal**
```
Sorted Input   [3,3]
Prepend 0      [0,3,3]
Deduplicate    [0,3] - index 3 yields 3
```
**Case 2 - Both values nonzero and unequal**
```
Sorted Input   [1,2]
Prepend 0      [0,1,2]
Deduplicate    [0,1,2] - index 3 yields 0
```
**Case 3 - Exactly one value zero**
```
Sorted Input   [0,1]
Prepend 0      [0,0,1]
Deduplicate    [0,1] - index 3 yields 1
```
**Case 4 - Both values zero**
```
Sorted Input   [0,0]
Prepend 0      [0,0,0]
Deduplicate    [0] - index 3 yields 0
```
---
*Alternate solution, also 7 bytes*
```
*eSQ}s{
```
[Try it online](https://pyth.herokuapp.com/?code=%2AeSQ%7Ds%7B&test_suite=1&test_suite_input=%5B3%2C3%5D%0A%5B1%2C2%5D%0A%5B1%2C0%5D%0A%5B0%2C1%5D%0A%5B0%2C0%5D&debug=0)
```
*eSQ}s{QQ   Trailing Q's inferred
      {Q    Deduplicate input
     s      Take the sum
    }   Q   Is this in the input? True treated as 1, false as 0
*           Multiplied by
 eSQ        Max from input (end of sorted input) 
```
---
*Previous version, 8 bytes*
```
@+0{-QZ3
```
[Answer]
# Java 8, 20 bytes
Curried lambda. [Stolen from here](https://codegolf.stackexchange.com/a/165326).
```
a->b->(a|b)>>(a*b&2)
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 17 bytes, port somehow from Python answer
```
a=>b=>a*b&2?0:a|b
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/e9m@z/R1i7J1i5RK0nNyN7AKrEm6X9yfl5xfk6qXk5@uka0np6eY1FRYqWGiWasXm5igYZGvE6mpq0dVoksoISbRqamRpYmEPwHAA "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), 21 bytes
```
a=>b=>a-b?a*b?0:a+b:a
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/e9m@z/R1i7J1i5RN8k@USvJ3sAqUTvJKvF/cn5ecX5Oql5OfrqGm4aBpoaxpuZ/AA "JavaScript (Node.js) – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 8 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
Ç∞∟∙◄╥*♣
```
[Run and debug it](https://staxlang.xyz/#p=80ec1cf911d22a05&i=[0,+0]%0A[0,+1]%0A[0,+2]%0A[0,+3]%0A[1,+0]%0A[1,+1]%0A[1,+2]%0A[1,+3]%0A[2,+0]%0A[2,+1]%0A[2,+2]%0A[2,+3]%0A[3,+0]%0A[3,+1]%0A[3,+2]%0A[3,+3]&a=1&m=2)
Unpacked, ungolfed, and commented, it looks like this.
```
    e.g.        [2, 0]
c:s [2, 0] 2    calculate the "span" of the input array (max(a) - min(a))
+   [2, 0, 2]   append the span to the input array
o   [0, 2, 2]   sort the 3-element array
E   0 2 2       explode the 3 elements into 3 separate stack entries
a   2 2 0       rotate the third stack element to the top of stack
!   2 2 1       logical not, produces 1 iff the top value was 0
*   2 2         multiply
                implicitly print top of stack
```
[Run this one](https://staxlang.xyz/#c=+++%09e.g.+++++%09[2,+0]%0Ac%3As%09[2,+0]+2+%09calculate+the+%22span%22+of+the+input+array+%28max%28a%29+-+min%28a%29%29%0A%2B++%09[2,+0,+2]%09append+the+span+to+the+input+array%0Ao++%09[0,+2,+2]%09sort+the+3-element+array%0AE++%090+2+2++++%09explode+the+3+elements+into+3+separate+stack+entries%0Aa++%092+2+0++++%09rotate+the+third+stack+element+to+the+stop%0A%21++%092+2+1++++%09logical+not,+produces+1+iff+the+top+value+was+0%0A*++%092+2++++++%09multiply%0A+++%09+++++++++%09implicitly+print+top+of+stack&i=[0,+0]%0A[0,+1]%0A[0,+2]%0A[0,+3]%0A[1,+0]%0A[1,+1]%0A[1,+2]%0A[1,+3]%0A[2,+0]%0A[2,+1]%0A[2,+2]%0A[2,+3]%0A[3,+0]%0A[3,+1]%0A[3,+2]%0A[3,+3]&a=1&m=2)
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), 32 bytes
```
{(({}[({})]<>)){{}<>}(<>)}{}({})
```
[Try it online!](https://tio.run/##SypKzMzTTctJzP7/v1pDo7o2Gog1Y23sNDWrq2tt7Go1gMza6lqQ6P//RgrGAA "Brain-Flak – Try It Online")
[Answer]
(first submission so please don't kick too hard)
# [Python 2](https://docs.python.org/2/), 57 44 43 bytes
```
lambda a,b:(0 if a*b else a+b)if a-b else a
```
[Try it online!](https://tio.run/##XctBCsIwEEbhfU7xg5tGI0xmdkJu4maCCRZqLTYbTx9TwVBcfg/e8i7358w1B1zrpI94U6iLl4EwZugxIk1rgp6i3Xz@uRpzQElrMctrnAvyIE5sCNLtHTdTNztq5m5yvtnvfmwBtC9s8Z/km6R@AA "Python 2 – Try It Online")
(compressed a bit after looking at [first python](https://codegolf.stackexchange.com/a/165326/80759) answer)
[Answer]
# C (gcc), 25 bytes
`f(a,b){a=a^b&&a*b?0:a|b;}`
pseudo-code:
```
foo(A,B)
    if A XOR B and A*B are > 0
        return 0
    else 
        return A OR B`
```
[Answer]
# C (gcc), 26 bytes
```
f(a,b){a=a*b?a-b?0:a:a+b;}
```
[Try it online!](https://tio.run/##fZBBDoIwEEX3nGKiMQFpDSorEDkIsGhBtESLUXQDPTsOiIqKTpqZRX/emzam2ziu61RnhBsl89iU@4xy33KYw0zuqnosZLy/JBtYnYtE5LPdWhOygAMTUr/mIjGg1KCr5oIFdgQelBaBOYEFgaVy3wL8X@B4wkiqjwAqmCTPE0pKTdpVKEcENVbU9HnbF21fRsaLlOYn0BufQJnl4liB7YJpiv7Gn160VYB4Hog@7Aua3aHZA5oNQQfgiMa/DrKoUww41M/l8OG9vNJUfQM "C (gcc) – Try It Online")
Expanation / Ungolfed:
```
int f(int a, int b) { // implicit-int (C89)
    // return replaced with assignment: [link](https://codegolf.stackexchange.com/a/106067/44694)
    return a*b ? // if a and b are both not zero, then
        a-b ? // if a != b
        0 : // a != b, so return 0
        a // a == b, so return a
    : a+b // one of a,b is zero, so return whichever is nonzero 
    ;
}
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 9 bytes
```
dGp*~GX>*
```
[Try it online!](https://tio.run/##y00syfn/P8W9QKvOPcJO6///aAMdo1gA "MATL – Try It Online")
### Explanation:
```
           % Implicit input as a vector with two elements implicitly. Stack: [0,2]
d          % The difference between the two elements. Stack: [2]
 G         % Push input again. Stack: [2], [0,2]
  p        % The product of the last element (the input). Stack: [2], [0]
   *       % Multiply the two elements on the stack. Stack: [0]
    ~      % Negate. Stack: [1]
     G     % Push input again. Stack: [1], [0,2]
      X>   % Maximum value. Stack: [1], [2]
        *  % Multiply the two elements on the stack. Stack: [2]
           % Implicit output
```
[Answer]
# GNU sed, 23 bytes
```
s/^0?(.)\1?0?$/\1/
t
c0
```
(must be run with `-r` flag)
[Try it online!](https://tio.run/##BcGxDcJAEETR/NdBgANzM7sFXCMWCSBEYls@0z7Le@P1nN/rt/Ya7a5@vU2Lu/qlLW6cPFQlIaNAiYWNAychwkQQSYo0GWT@tv38bOuo@fgD "sed – Try It Online")
[Answer]
# QBasic, 34 bytes
Different approach!
```
INPUT a,b
?(a OR b)*-(a*b=0OR a=b)
```
Observe that the nonzero values in the output grid are all the bitwise `OR` of the two input numbers. This is just `a OR b` in QBasic. We want to output this value when `a*b=0 OR a=b`, and `0` otherwise, which we can do by multiplying by the negative of the aforementioned conditional (negative, since truthy is `-1` in QBasic).
[Answer]
# brainfuck, 25 bytes
```
,>,[>]<<[[->->+<<]>[>]]>.
```
Input is two byte values (not ascii) 
[Answer]
# [Swift](https://swift.org/), 118 bytes
```
func c(n1:Int,n2:Int){n1==n2 ? print("\(n1)") : (n1*n2 != 0 ? print("0") : (n1==0 ? print("\(n2)") : print("\(n1)")))}
```
[Answer]
## Batch, ~~38~~ ~~36~~ ~~35~~ 30 bytes
```
@cmd/cset/a"(%1|%2)>>(%1*%2&2)
```
Port of @Dennis's Python answer, as conditionals are too expensive in Batch.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 10 bytes
```
=h|∋0&⌉|∧0
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/3zaj5lFHt4Hao55OIGO5wf//0cY6RrH/owA "Brachylog – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 8 7 bytes
1 byte saved by H.PWiz. 
```
>.*=^<.
```
[Try it online!](https://tio.run/##y/qfVmyrp2CgYKVg8N9OT8s2zkbvvyaXkp6CepqtnrqCjkKtlUJaMRdXanJGPlBZGhBD2EZIbEMg2xjCNEYw0/TV9Oyqresy9Uy4/gMA "J – Try It Online")
A J port of H.PWiz's APL solution
`=` are the numbers equal? (results in 1 or 0)
`^` to the power of 
`<.` the smaller number
`*` multiplied by
`>.` the larger number
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~9~~ 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
àIËIP_+*
```
-1 byte thanks to *@MagicOctopusUrn*.
[Try it online](https://tio.run/##MzBNTDJM/f//8ALPw92eAfHaWv//RxvpGMcCAA) or [verify all test cases](https://tio.run/##HcghDoAwDEDR@wBibcM98MtCIOE0XAKLmUPhOs@VyvLNEy/N2y5HfI/f0S6v7fS6rOMQxd/IOU2pTF1BResKL7zwwiuvvPLKG2@88da//A).
**Explanation:**
```
à         # Take the maximum of the input-list
          #  [0,2] → 2
IË        # Are all elements in the input-list equal?
          #  [0,2] → 0
  IP_     # Take the product of the input-list, and verify if it equals 0
          # (`_` transforms 0 into 1; everything else into 0)
          #  [0,2] → 0 (product) → 1 (==0)
     +    # Add them together (since only 1 is truthy in 05AB1E, this is basically an OR)
          #  0+1 → 1
*         # Multiply both values on the stack
          #  2*1 → 2
```
**Generalized explanation:**
```
IËIP_+    # If both values are equal, or one of them is a zero:
 à        #  Output the maximum of the two values
          # Else:
          #  Output 0
```
[Answer]
# Javascript, 35 bytes
```
f=(m,n)=>(m||n)&&(m!=n)?(m>n?m:n):0
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
ê0ýÙ7è
```
[Try it online!](https://tio.run/##ASoA1f8wNWFiMWX/M8Odw6N2eXl5/8OqMMO9w5k3w6j/eSLDvyAtPiDDvyIsXP8 "05AB1E – Try It Online")
Port(ish) of [my Pyth answer](https://codegolf.stackexchange.com/a/165434/41020).
*TIO header/footer taken from [Emigna's answer](https://codegolf.stackexchange.com/a/165358/41020)*
[Answer]
# Javascript ES6, 25 22 21 20 bytes
```
a=>b=>a?b-a?!b*a:a:b
```
**14 13 bytes**, If the arguments are provided in sorted order
```
a=>b=>a%b?0:b
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~34~~ 28 bytes
```
lambda i,j:(i|j,0)[0<i!=j>0]
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFTJ8tKI7MmS8dAM9rAJlPRNsvOIPZ/Wn6RQoVCZp5CUWJeeqqGiaaCFZcCEIDEK7GIg0BBUWZeiUJCRYKCtoKSjhKQTKgEsxVs7RTA3DSNCp1KzYT/AA "Python 2 – Try It Online")
-6 with thanks to @Dennis
[Answer]
# QBasic, ~~38~~ ~~36~~ 35 bytes
```
INPUT a,b
?(a*b>0)*(b-a*(a<>b))+a+b
```
Partly inspired by [Erik's `IF ... THEN ... ELSE` answer](https://codegolf.stackexchange.com/a/167073/16766), here's a math-only solution.
### How I got here
*Important note for understanding math-with-conditionals: in QBasic, the results of comparison operators are `0` and `-1`, not `0` and `1`.*
We start with Erik's code:
```
IF a*b THEN?a*-(a=b)ELSE?a+b
```
In other words, if `a` and `b` are both nonzero, then print `a*-(a=b)` (`a` if `a=b`, otherwise `0`); else (at least one of `a` and `b` is zero), output `a+b` (the nonzero number, or `0` if they're both zero).
There's already some math with conditionals going on here. Let's take it a step farther and see if we can eliminate the `IF` statement entirely. We'll have to use `a*b>0` for the outer condition: `a*b` can have multiple different truthy values, which is fine for `IF` but causes problems for math.
```
c=a*b>0
?c*a*(a=b)+(c+1)*(a+b)
```
This is the [standard trick](https://codegolf.stackexchange.com/a/166130/16766) of `IF`-elimination. When `c` is true, `c*a*(a=b)` is `-a*(a=b)` and `(c+1)*(a+b)` is `0`; when `c` is false, `c*a*(a=b)` is `0` and `(c+1)*(a+b)` is `a+b`. So this expression gives the same results as the `IF ... THEN ... ELSE`. The only problem is, it makes our program 40 bytes instead of 38. Maybe we can shorten it by rearranging the math.
```
c=a*b>0
?c*a*(a=b)+c*(a+b)+a+b
```
Still 40 bytes...
```
c=a*b>0
?c*(a+b+a*(a=b))+a+b
```
Now our program is back to 38 bytes. But since we're only using `c` once, we don't have to assign it to a variable anymore:
```
?(a*b>0)*(a+b+a*(a=b))+a+b
```
Now we're down to 36 bytes.
*But wait there's more...* That `a+b+a*(a=b)` expression looks a bit redundant. `a*(a=b)` is `-a` if `a=b` and `0` otherwise. When we add it to `a`, we get `0` if `a=b` and `a` otherwise. Maybe we can achieve the same thing in fewer bytes by reversing the condition.
```
b+a*-(a<>b)
```
At first, this doesn't look shorter. But we can save a byte by subtracting instead of adding a negative:
```
b-a*(a<>b)
```
And there we have our 35-byte solution.
[Answer]
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), 187 bytes
```
,.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]Ajax:Listen tothy!Puck:Listen tothy!Be
you nicer zero?If notyou be I.Am I worse a cat?If notam I as big as you?If notyou zero.Open heart
```
[Try it online!](https://tio.run/##VY0/CwIxDMX3@xRxP4rgdouc4FAQFBzFIVejV/@kR5tDzy9fG3DQKS@/vPeShnvOtWmv@KrNbnS3op2AbczeEZOKw5qFIqgFkE@grqNuzcYnIQYJ0k8zxf9kRdUURmDvSvxNMSztGTiIwq5Um/YBFp4hJgIEh/K9o2JM0PmLjmL/CWqP2Q7lSU8YJed5tfgA "Shakespeare Programming Language – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 15 bytes
```
?0⁼?0⁼∨??⁼∨??∴*
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCI/MOKBvD8w4oG84oioPz/igbziiKg/P+KItCoiLCIiLCIxXG4yIl0=)
Surprisingly no Vyxal answer yet. Return the max, multiplied by the boolean value indicating whether the values are equal or one of them is zero.
---
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
s0pU3i
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCJgKDAsIDApIC0+IDBcbigwLCAxKSAtPiAxXG4oMCwgMikgLT4gMlxuKDAsIDMpIC0+IDNcbigxLCAwKSAtPiAxXG4oMSwgMSkgLT4gMVxuKDEsIDIpIC0+IDBcbigxLCAzKSAtPiAwXG4oMiwgMCkgLT4gMlxuKDIsIDEpIC0+IDBcbigyLCAyKSAtPiAyXG4oMiwgMykgLT4gMFxuKDMsIDApIC0+IDNcbigzLCAxKSAtPiAwXG4oMywgMikgLT4gMFxuKDMsIDMpIC0+IDNgXG5cbmBcXG5gLyBgIC1gLyB2aEUgXG7GmyIsInMwcFUzaSIsIm5TJFwiYCUgLT4gJWAkJTtgXFxuYGoiLCIiXQ==)
Thanks @lyxal for this version which ports the Pyth answer.
]