Se a declaração que testa se um valor estiver no intervalo

if ((x >= xmin) && (x <= xmax)) {
  // something
}
GamingDub