Scala Float floor() method with example
Last Updated :
29 Oct, 2019
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:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.4 ).floor
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = (- 3.8 ).floor
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...