Skip to content
Related Articles

Related Articles

Scala Float min() method with example
  • Last Updated : 29 Oct, 2019

The min() method is utilized to return the minimum value of the two specified float numbers.

Method Definition: (First_Number).min(Second_Number)

Return Type: It returns the minimum value of the two specified float numbers.

Example #1:




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



5.9

Example #2:




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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :