function [out] = rounddown(in);
%rounds up to the nearest integer
out=round(in-.5);

%valid to about 10 sig figs