float value is closer to an X or Y value?
something like
bool isCloserTo(float value, float x, float y)
{
//stuff
}
Maybe something like this? float isCloserTo (float value, float x, float y) { diffX = Math.Abs(value - x); diffY = Math.Abs(value - y); return diffX < diffY ? x : y }
Обсуждают сегодня