int lastdata = 39;
int loradata = 20;
int datatemp;
int tempmin = -50;
int tempmax = 70;

void setup() {
Serial.begin(115200);

}

void loop() {
Serial.println(lastdata);
datatemp = lastdata;
if(loradata>(datatemp+5) || loradata<(datatemp-5) && (loradata<tempmax || loradata>tempmin) )  
{
Serial.println("en dehors du range ou max");
}
else
{
  Serial.println("Ok");
}
delay(1000);
}