Skip to content
Related Articles

Related Articles

Getting ceiling value of x in Julia – ceil() Method

View Discussion
Improve Article
Save Article
  • Last Updated : 21 Apr, 2020
View Discussion
Improve Article
Save Article

The ceil() is an inbuilt function in julia which is used to return the nearest integral value greater than or equal to the specified value x.

Syntax: ceil(x)

Parameters:

  • x: Specified value.

Returns: It returns the nearest integral value greater than or equal to the specified value x.

Example 1:




# Julia program to illustrate 
# the use of ceil method
  
# Getting the nearest integral value 
# greater than or equal to the
# specified value x.
println(ceil(5))
println(ceil(5.9))
println(ceil(5.5))

Output:

5
6.0
6.0

Example 2:




# Julia program to illustrate 
# the use of ceil method
  
# Getting the nearest integral value 
# greater than or equal to the
# specified value x.
println(ceil(2))
println(ceil(2.1))
println(ceil(2.4))
println(ceil(2.5))
println(ceil(2.6))
println(ceil(2.9))

Output:

2
3.0
3.0
3.0
3.0
3.0
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!