Scala Float max() method with example
Last Updated :
29 Oct, 2019
The max() method is utilized to return the maximum value of the two specified float numbers.
Method Definition: (First_Number).max(Second_Number)
Return Type: It returns the maximum value of the two specified float numbers.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.9 ).max( 9.0 )
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.0 ).max( 5.0 )
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...