Given two real numbers (postive or negative) in the limits of float pointing number data types, i.e., (\$-3.4e38\$ to \$3.4e38\$) not inclusive, you should output the max of the two reversed numbers.
TEST CASES
Example
Input:
135
210
Output:
531
\$531\$ is \$135\$ reversed, which is greater than \$012\$, i.e., \$210\$ reversed.
Negative numbers are allowed:
Example 2
Input:
-135
-210
Output:
-012
\$-012\$ is \$-210\$ reversed, which is greater than \$-531\$, i.e., \$-135\$ reversed.
Real numbers are allowed:
Example 3
Input:
13.5
10
Output:
5.31
\$5.31\$ is \$13.5\$ reversed, which is greater than \$01\$, i.e., \$10\$ reversed.
Example 4
Input:
-1112313.5
-312.5671
Output:
-5.3132111
\$-5.3132111\$ is \$-1112313.5\$ reversed (it reverses the number but is still negative, which is greater than \$-1765.213\$, i.e., \$-312.5671\$ reversed.
Example 5
Input:
0.0000001
0
Output:
1000000.0
\$1000000.0\$ is \$0.0000001\$ reversed, which is greater than \$0\$, i.e., still \$0\$ reversed.
Example 6
Input:
121
121
Output:
121
Both numbers are equal and are palindrome. Either one is correct.
Rules
- Standard loopholes apply
- This is code-golf, so the shortest program in bytes wins.
10.0
would reverse to0.01
, while10
would reverse to01
or1
? Some languages might consider10
and10.0
equal or even not distinguish them at all. It seems like it's really a number string that's the input. I guess it don't matter since probably everyone will take the number as a string anyway (which is allowed by default). \$\endgroup\$ – xnor Nov 2 '19 at 3:32-5.3132111
\$\endgroup\$ – Nick Kennedy Nov 2 '19 at 21:570
s in the results, like-012
or1000000.0
. Are these0
s required in the output, or could you output-12
and1000000
? \$\endgroup\$ – Business Cat Nov 4 '19 at 19:47