Open In App

Scala Float isNegInfinity() method with example

Last Updated : 29 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The isNegInfinity() method is utilized to return true if the Float value or the specified float value is negative infinity number, or false otherwise.

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.

Example #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)
      
    }


Output:

false

Example #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)
      
    }


Output:

false


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads