Scala: How to square a number (Int, Double, Float, Long)
1. Squaring numbers in Scala can be done by multiplying the number by itself or using Math.pow function.
2. When squaring an integer in Scala with Math.pow function, the result will be a Double.