Scala Byte *(x: Double): Double
在Scala中,Byte是一个8位有符号整数(与Java的byte原始类型相当)。使用*(x: Double)
方法返回该值与x的乘积。
方法定义: Byte *(x: Double): Double
返回类型: 它返回该值与x的乘积。
示例1:
// Scala program of Byte *(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Byte *(x: Double) function
val result = (64.toByte).*(12:Double)
// Displays output
println(result)
}
}
输出:
768.0
示例2:
// Scala program of Byte *(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Byte *(x: Double) function
val result = (17.toByte).*(128:Double)
// Displays output
println(result)
}
}
输出:
2176.0
更多Scala相关文章,请阅读:Scala 教程