+ 1

STRANGE OUTPUT when using the POW function !!! (Sololearn code playground)

This problem happened on sololearn's code playground I tried to print the powers of 10 using the pow function But for some powers like 2,4,7,8,9 the output was the real answers -1 (99, 9999...) https://code.sololearn.com/cpgbKSC5QiqU/?ref=app Why does this happen?! any ideas?

27th Feb 2018, 7:16 PM
Anas Alrayes
Anas Alrayes - avatar
2 odpowiedzi
+ 4
pow returns a double. Don't feed it with integers. edit: k must be double. Forgot to add that.
27th Feb 2018, 7:18 PM
Alex
Alex - avatar
0
Thanks, It works now, although what happened with the integer is still weird 😅
27th Feb 2018, 7:58 PM
Anas Alrayes
Anas Alrayes - avatar