Scala Float floor() method with example Last Updated : 29 Oct, 2019 Improve Improve Like Article Like Save Share Report The floor() method is utilized to returns a float number which is less than or equal to the given float number. Method Definition: (Float_Number).floor Return Type: It returns a float number which is less than or equal to the given float number. Example #1: // Scala program of Float floor() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying floor method val result = (5.4).floor // Displays output println(result) } } Output: 5.0 Example #2: // Scala program of Float floor() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying floor method val result = (-3.8).floor // Displays output println(result) } } Output: -4.0 Like Article Suggest improvement Previous Scala Char /(x: Short) method with example Next Scala Char ^(x: Char) method with example Share your thoughts in the comments Add Your Comment Please Login to comment...