The Wayback Machine - https://web.archive.org/web/20230207003420/https://www.geeksforgeeks.org/getting-floor-value-of-x-in-julia-floor-method/
Skip to content
Related Articles
Open in App
Not now

Related Articles

Getting floor value of x in Julia – floor() Method

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

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

Syntax: floor(x)

Parameters:

  • x: Specified value.

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

Example 1:




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

Output:

5
5.0
5.0

Example 2:




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

Output:

2
2.0
2.0
2.0
2.0
2.0
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!