Is it possible to check if two numbers are equal only with arithmetic operators?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












I'm trying to find a function f(x,y) that returns 1 if the numbers are equal or 0 otherwise.



But I cannot wrap my head around it since I can't use functions like floor/ceil/absolute val.










share|cite|improve this question

















  • 1




    Are all functions you are allowed to use continuous? Are you allowed to use limits?
    – Hagen von Eitzen
    Sep 2 at 8:21










  • just arithmetic operators
    – oren revenge
    Sep 2 at 8:23














up vote
0
down vote

favorite
1












I'm trying to find a function f(x,y) that returns 1 if the numbers are equal or 0 otherwise.



But I cannot wrap my head around it since I can't use functions like floor/ceil/absolute val.










share|cite|improve this question

















  • 1




    Are all functions you are allowed to use continuous? Are you allowed to use limits?
    – Hagen von Eitzen
    Sep 2 at 8:21










  • just arithmetic operators
    – oren revenge
    Sep 2 at 8:23












up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





I'm trying to find a function f(x,y) that returns 1 if the numbers are equal or 0 otherwise.



But I cannot wrap my head around it since I can't use functions like floor/ceil/absolute val.










share|cite|improve this question













I'm trying to find a function f(x,y) that returns 1 if the numbers are equal or 0 otherwise.



But I cannot wrap my head around it since I can't use functions like floor/ceil/absolute val.







elementary-number-theory






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Sep 2 at 8:17









oren revenge

328112




328112







  • 1




    Are all functions you are allowed to use continuous? Are you allowed to use limits?
    – Hagen von Eitzen
    Sep 2 at 8:21










  • just arithmetic operators
    – oren revenge
    Sep 2 at 8:23












  • 1




    Are all functions you are allowed to use continuous? Are you allowed to use limits?
    – Hagen von Eitzen
    Sep 2 at 8:21










  • just arithmetic operators
    – oren revenge
    Sep 2 at 8:23







1




1




Are all functions you are allowed to use continuous? Are you allowed to use limits?
– Hagen von Eitzen
Sep 2 at 8:21




Are all functions you are allowed to use continuous? Are you allowed to use limits?
– Hagen von Eitzen
Sep 2 at 8:21












just arithmetic operators
– oren revenge
Sep 2 at 8:23




just arithmetic operators
– oren revenge
Sep 2 at 8:23










1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










This suggestion may raise a heated discussion, but
$$f(x,y)=0^(x-y)^2$$
works. Note that $0^0=1$ whereas $0^a=0$ for any $a>0$.






share|cite|improve this answer




















  • This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
    – Simon Terrington
    Sep 2 at 8:30










  • @SimonTerrington The heated discussion has begun!
    – Sobi
    Sep 2 at 8:45










  • :) and by the way I don't have a better idea and I really like your answer.
    – Simon Terrington
    Sep 2 at 8:49










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2902481%2fis-it-possible-to-check-if-two-numbers-are-equal-only-with-arithmetic-operators%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










This suggestion may raise a heated discussion, but
$$f(x,y)=0^(x-y)^2$$
works. Note that $0^0=1$ whereas $0^a=0$ for any $a>0$.






share|cite|improve this answer




















  • This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
    – Simon Terrington
    Sep 2 at 8:30










  • @SimonTerrington The heated discussion has begun!
    – Sobi
    Sep 2 at 8:45










  • :) and by the way I don't have a better idea and I really like your answer.
    – Simon Terrington
    Sep 2 at 8:49














up vote
6
down vote



accepted










This suggestion may raise a heated discussion, but
$$f(x,y)=0^(x-y)^2$$
works. Note that $0^0=1$ whereas $0^a=0$ for any $a>0$.






share|cite|improve this answer




















  • This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
    – Simon Terrington
    Sep 2 at 8:30










  • @SimonTerrington The heated discussion has begun!
    – Sobi
    Sep 2 at 8:45










  • :) and by the way I don't have a better idea and I really like your answer.
    – Simon Terrington
    Sep 2 at 8:49












up vote
6
down vote



accepted







up vote
6
down vote



accepted






This suggestion may raise a heated discussion, but
$$f(x,y)=0^(x-y)^2$$
works. Note that $0^0=1$ whereas $0^a=0$ for any $a>0$.






share|cite|improve this answer












This suggestion may raise a heated discussion, but
$$f(x,y)=0^(x-y)^2$$
works. Note that $0^0=1$ whereas $0^a=0$ for any $a>0$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Sep 2 at 8:23









Hagen von Eitzen

267k21259482




267k21259482











  • This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
    – Simon Terrington
    Sep 2 at 8:30










  • @SimonTerrington The heated discussion has begun!
    – Sobi
    Sep 2 at 8:45










  • :) and by the way I don't have a better idea and I really like your answer.
    – Simon Terrington
    Sep 2 at 8:49
















  • This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
    – Simon Terrington
    Sep 2 at 8:30










  • @SimonTerrington The heated discussion has begun!
    – Sobi
    Sep 2 at 8:45










  • :) and by the way I don't have a better idea and I really like your answer.
    – Simon Terrington
    Sep 2 at 8:49















This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
– Simon Terrington
Sep 2 at 8:30




This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^0$. Possibilities include $0$, $1$ and undefined. en.wikipedia.org/wiki/Zero_to_the_power_of_zero
– Simon Terrington
Sep 2 at 8:30












@SimonTerrington The heated discussion has begun!
– Sobi
Sep 2 at 8:45




@SimonTerrington The heated discussion has begun!
– Sobi
Sep 2 at 8:45












:) and by the way I don't have a better idea and I really like your answer.
– Simon Terrington
Sep 2 at 8:49




:) and by the way I don't have a better idea and I really like your answer.
– Simon Terrington
Sep 2 at 8:49

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2902481%2fis-it-possible-to-check-if-two-numbers-are-equal-only-with-arithmetic-operators%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Carbon dioxide

Why am i infinitely getting the same tweet with the Twitter Search API?