Question about round?

Dear all,

In Matlab ,

>> round(2.5)

ans =


But in Julia,

julia> round(2.5)

If I want to get the same result which is from Matlab, how to write the code in Julia?

julia> round(2.5, RoundNearestTiesAway)

see also: IEEE 754 - Wikipedia

Julia defaults to round ties to even. You can use round(x, RoundDown) to round to take the floor. The rounding modes are RoundDown,RoundNearestTiesUp,RoundUp,RoundFromZero,RoundNearestTiesAway, and RoundToZero

@Oscar_Smith @jling Thank you very much for both of your help.