From Float type to Integer

Hi,

I wanted to obtain integer output instead of float type output from functions:
floor(4.56), ceil(4.56). I would be glad to know how to obtain integer output for the same.

Also, I read in documentation, interger division is performed using div(x,y) function. Is there any method to obtain integer output from the usually used: x/y (which is used for division in most languages)

Thank You

floor(Int, 4.65)

Use \div for that operation.

julia> 100 ÷ 2
50

julia> 100 ÷ 3
33
1 Like