Scala Char %(x: Double) 方法的例子
%(x: Double) 方法被用于查找指定字符值除以类型为 Double 的二进制数 ‘x’ 的余数。
方法定义:def %(x: Double): Double
返回值类型:返回 Double。
例子:1#
// Scala program of %(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying %(x: Double) method
val result = 'E'.%(10.4536)
// Displays output
println(result)
}
}
6.278400000000001
例子:2#
// Scala program of %(x: Double)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying %(x: Double) method
val result = 'B'.%(15.7644)
// Displays output
println(result)
}
}
2.9423999999999992
更多Scala相关文章,请阅读:Scala 教程
极客教程