Open In App

Scala Float isPosInfinity() method with example

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

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

Method Definition: (Float_Number).isPosInfinity

Return Type: It returns true if the Float value or the specified float value is positive infinity number, or false otherwise.

Example #1:




// Scala program of Float isPosInfinity()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isPosInfinity method
        val result = (7.965).isPosInfinity
          
        // Displays output
        println(result)
      
    }


Output:

false

Example #2:




// Scala program of Float isPosInfinity()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isPosInfinity method
        val result = (0.0/0.0).isPosInfinity
          
        // Displays output
        println(result)
      
    }


Output:

false


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads