FUNCTION f_to_c, temp_in temp_out = (temp_in - 32.) $ *5./9. ;Radix points force floating point division RETURN, temp_out END PRO c_to_f, temp_in, temp_out temp_out = temp_in*9./5. + 32. RETURN END PRO temp_example ;Create 5 random temperatures between 32 and 132 deg F temp_far = RANDOMU(1,5)*100. + 32. PRINT, 'Fahrenheit temperatures:' PRINT, temp_far ;Calling a function to do the work temp_cent = f_to_c(temp_far) PRINT, 'Centigrade temperatures:' PRINT, temp_cent PRINT, '' PRINT, '' PRINT, 'Trying a new case...' ;Create 5 random temps between -40 and 40 deg C temp_cent2 = RANDOMU(1,5)*80. - 40. PRINT, 'Centigrade temperatures:' PRINT, temp_cent2 ;Calling a procedure to perform the conversion c_to_f, temp_cent2, temp_far2 PRINT, 'Fahrenheit temperatures:' PRINT, temp_far2 STOP END