Open In App

Scala Float isInfinite() method with example

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

The isInfinite() method is utilized to return true if the specified Float value is infinite otherwise return false.

Method Definition: (Number).isInfinite

Return Type: It returns true if the specified Float value is infinite otherwise return false.

Example #1:




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


Output:

false

Example #2:




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


Output:

false


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads