Scala Float isInfinity() method with example Last Updated : 29 Oct, 2019 Improve Improve Like Article Like Save Share Report The isInfinity() method is utilized to return true if the specified Float value is infinite otherwise return false. Method Definition: (Number).isInfinity Return Type: It returns true if the specified Float value is infinite otherwise return false. Example #1: // Scala program of Float isInfinity() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying isInfinity method val result = (5.4).isInfinity // Displays output println(result) } } Output: false Example #2: // Scala program of Float isInfinity() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying isInfinity method val result = (7/3).isInfinity // Displays output println(result) } } Output: false Like Article Suggest improvement Next Scala Float isInfinite() method with example Share your thoughts in the comments Add Your Comment Please Login to comment...