Scala Float ceil() method with example
Last Updated :
29 Oct, 2019
The ceil() method is utilized to returns number which is greater than or equal to the given number.
Method Definition: def ceil: Float
Return Type: It returns a number which is greater than or equal to the given number.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.4 ).ceil
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = (- 3.8 ).ceil
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...