Scala: How to square a number (Int, Double, Float, Long)
Briefly

An important point to know about this solution is that if you square an integer, the result will actually be a Double, so you'll need to convert it back to an Int or a Long, if you want those types.
Read at Alvinalexander
[
|
]