Scala program to get the base 10 logarithm of a Double number using scala.math.log10() function
// Scala program to get the base 10 logarithm of a
// Double number using scala.math.log10() function
object Sample{
def main(args:Array[String]){
var num:Double = 0;
var res:Double = 0;
print("Enter number: ")
num=scala.io.StdIn.readDouble()
res= scala.math.log10(num)
println("Base 10 logarithm is: "+res);
}
}
Output
Enter number: 23.4
Base 10 logarithm is: 1.3692158574101427