๐Ÿงญ Helm

Absolute Zero, Approximately

Stardate 55112.3 ยท UES Magnanimous

Briefing

The long-range sensor package reports temperature in Celsius. Lt. Skree's analysis suite requires Kelvin, and Skree has requested the conversion be done "correctly, to two decimal places, and without any of the drama that attended the last attempt".

The last attempt, for the record, returned 273.14999999999998 for a reading of zero, and Skree filed a formal complaint about the "aesthetic and moral" quality of the number. Commander Raghunathan has asked that you round it. She has also asked that nobody mention floating point to Skree ever again.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขZero Celsius is 273.15 K
  • โ€ขAbsolute zero, minus 273.15, is 0.0 K
  • โ€ขBoiling water at 100 is 373.15 K
  • โ€ขRoom temperature, 21.5, is 294.65 K
  • โ€ขThe result is rounded to two decimal places
Ask Commander Raghunathan for a hint

Add 273.15, then round to two decimal places. Python has round(x, 2). Rust does not round to places directly: multiply by 100, .round(), divide by 100.