带有示例的 Scala Float isNegInfinity() 方法
isNegInfinity()方法用于在 Float 值或指定的浮点值是负无穷大时返回 true,否则返回 false。
Method Definition: (Float_Number).isNegInfinity
Return Type: It returns true if the Float value or the specified float value is negative infinity number, or false otherwise.
示例 #1:
// Scala program of Float isNegInfinity()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isNegInfinity method
val result = (8.9).isNegInfinity
// Displays output
println(result)
}
}
输出:
false
示例 #2:
// Scala program of Float isNegInfinity()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isNegInfinity method
val result = (-7.965).isNegInfinity
// Displays output
println(result)
}
}
输出:
false