Can number outputs only be represented in int or floats or are there any way to represent a square root in the output? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Can number outputs only be represented in int or floats or are there any way to represent a square root in the output?

Just tell me how if there is a way and a code with comments will be helpful thanks!

8th Aug 2017, 2:47 PM
HJšŸ“TDM
3 Respostas
+ 10
Numbers can be *stored* as either integers or floating-point values. As for output, it is up to you to do the magic through calculations. https://code.sololearn.com/cbyhPCt7aOau/?ref=app
8th Aug 2017, 3:12 PM
Hatsy Rei
Hatsy Rei - avatar
+ 6
There are languages which can store irrational numbers and make proper, non-decimal calculations on them. Neither of those is available at SoloLearn, though...
8th Aug 2017, 3:19 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
in Java we have function sqrt(/*number*/);
8th Aug 2017, 3:10 PM
Š”Š°Š½ŠøŠøŠ» Š¢ŠøтŠ¾Š²
Š”Š°Š½ŠøŠøŠ» Š¢ŠøтŠ¾Š² - avatar