📅  最后修改于: 2022-03-11 14:49:00.954000             🧑  作者: Mango
int value = 30;
int factor = 16;
int nearestMultiple =
(int)Math.Round(
(value / (double)factor),
MidpointRounding.AwayFromZero
) * factor;