MeteorRain,
Note, BitAnd() is a function, with significant lookup overhead (although not so much in avs+ compared to avs std, I think hash table was implemented in avs+),
whereas
ops below are done directly via the parser, and quite a bit faster [will though make little difference unless in some runtime script].
Code:
\ (RoundMode==0) ? value / factor * factor [* Down *]
\ : (RoundMode==1) ? (value*2+factor)/(2*factor)*factor [* Nearest : About same as (value+factor/2)/factor*factor but without intermediate result precision loss *]
\ : (RoundMode==2) ? (value+factor-1)/factor*factor [* Up *]
\ : (RoundMode==3) ? (value-1)/factor*factor [* ALWAYS_DOWN : Rare Use <EDIT: Result always less than Value, except where Value=0> *]
\ : (value+factor)/factor*factor [* ALWAYS_UP : Rare Use <EDIT: Result always greater than Value> *]
EDIT: Also, I suggest that method that works for all values of factor is a better option, with possible exception being above
Simpler Nearest when factor is power of 2(1,2,4 etc, likely most often).