Scala Double >(x: Byte) 方法
在 Scala 中,Double 是一个 64 位浮点数,相当于 Java 的 double 原始类型。>(x: Byte) 方法用于返回 true 如果此值大于 x,否则返回 false。
方法定义 – def >(x: Byte): Boolean
返回值 – 如果此值大于 x,则返回 true,否则返回 false。
示例 #1:
// Scala program to explain the working
// of Double >(x: Byte) method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying >(x: Byte) function
val result = (12.00123.toDouble).>(15:Byte)
// Displays output
println(result)
}
}
false
示例 #2:
// Scala program to explain the working
// of Double >(x: Byte) method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying >(x: Byte) function
val result = (75.00123.toDouble).>(9:Byte)
// Displays output
println(result)
}
}
true
更多Scala相关文章,请阅读:Scala 教程
极客教程