Scala Int /(x: Long)方法及示例
/ ( x: Long) 方法是用来返回指定的int值除以long值时的商。
方法定义:(Int_Value)./(Long_Value)
返回类型。当指定的int值除以long值时,它返回商。
例子 #1 :
// Scala program of Int /(x: Long)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int /(x: Long) function
val result = (100)./(10)
// Displays output
println(result)
}
}
输出。
10
例子#2
// Scala program of Int /(x: Long)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying Int /(x: Long) function
val result = (110)./(9)
// Displays output
println(result)
}
}
输出。
12
极客教程