Storing values in the board after rebooting

Hello, I have an Arduino board and an analog temperature sensor and I want to connect it to an external power supply unit and let it measure the maximum and the minimum temperature, the only issue is that when I disconnect it from the supply unit the void Setup runs and reset the values.
Here is the code I used:

const int termo = A0;

double Max;
double Min;
double temp;

void setup() {

  pinMode(termo,INPUT);
  temp = GetTemp(analogRead(termo));
  Max = temp;
  Min = temp;

  Serial.begin(9600);

  delay(50);
  
}

void loop() {

  
  double a = GetTemp( analogRead(termo) );
  Clear();
  
    if(a > Max){
    Max = a;
  }
  else{
    if(a < Min){
    Min = a;
   }
  }

  

  Serial.print("Current Temperature: ");
  Serial.println(a);
  Serial.println();
  Serial.print("Maximum Temperature: ");
  Serial.println(Max);
  Serial.print("Minimum Temperature: ");
  Serial.println(Min);
  delay(500);
}



double GetTemp(int RawADC) {
  double Temp;
  Temp = log(10000.0*((1024.0/RawADC-1))); 
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
  Temp = Temp - 273.15;            // Convert Kelvin to Celcius
   //Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
   return Temp;
}

void Clear(){
  for(int i = 0;i<1;i++){
    Serial.println();
  }
}

It's a great solution for finding the maximum and minimum temperature values like I wanted when it's connected to my computer(and I see that through the serial monitor) but it's useless when I want to connect it to an external power supply and see the values afterwards when I have an access to a computer.
I considered buying an SD module and saving the values there but using an SD card for this purpose it's overkill because most of them can provide about 8 Gb when I need 8 bytes(2 double variables).
So can somebody give me an optimal solution for my problem?

Using the built-in EEPROM seems to be be a perfect fit to your problem. Read the documentation of the EEPROM library included with the IDE.
Use EEPROM.put to save Min and Max every time one of them is updated. Use EEPROM.get to restore the values in your setup() function.
How often do you need to reset the min and max values? Are they "eternal", i. e. "the highest temperature ever encountered since I installed this device" or do you need to reset the min and max, i. e. "the highest temperature since this morning when I restarted the device"? In the latter case you may want to provide a method to reset the EEPROM values. Maybe include a button input for "if button is held down while restarting then reset previous min and max values"

Just be aware of the maximum number of write cycles; 100k for a cell.

So only write to EEPROM when the values change. Or implement a means of wear leveling. Or use an external FRAM module.