X**Y = X^Y .
Eg: 10**3= 10^3=10×10×10=1000 .
Now see your code and imagine for
(10**)10 **10= 10^(10^10)
This can be calculate but there in program have some rule & limit , that's why your results is "infinity"
if the number is not inside that range then it will display "infinity"
Am I right?