1. 程式人生 > >round() Function in Python and Matlab

round() Function in Python and Matlab

Python always round to nearest even.

test_1 = np.around(3.5)
test_2 = np.around(4.5)

test_1 = 4

test_2 = 4

test_1 = round(3.5)
test_2 = round(4.5)

test_1 = 4

test_2 = 5