Challenge
- Input two integers.
- Integer I/O must be decimal.
- If the integers are equal, output a truthy value.
- Otherwise, output a falsy value.
Clarifications
- You will never receive non-integer inputs.
- You will never receive an input that is outside the bounds [-2³¹, 2³¹).
Rules
- Standard loopholes are disallowed.
- This is code-golf. Shortest answer wins, but will not be selected.
int f(int a, int b){ return a==b;}
? Becauseint
in C represents numbers with base-2 bit-patterns, not decimal. (The details are implementation-defined, but there are enough requirements in the C standard that I don't think an implementation could legally choose a BCD (binary-coded-decimal) representation. At least not forunsigned char
.) I think you're getting mixed up by source code that looks likeint a = 1234;
. That uses a decimal representation in the source, but not in the program.int a=0x4d2;
is identical to1234
. \$\endgroup\$ – Peter Cordes Jan 10 '18 at 4:20