$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB4" '/*------------------------------------------------------------------*/ ' CVC2F(DOUBLE) ' Convert Celsius to Fahrenheit. ' Converts Celsius DOUBLE to Fahrenheit. ' EXAMPLE: CVC2F(37.777) = 100 ' CVC2F(32.222) = 90 ' CVC2F(26.666) = 80 ' CVC2F(21.111) = 70 ' CVC2F(15.555) = 60 ' CVC2F(10.000) = 50 ' CVC2F(4.444) = 40 ' CVC2F(-1.111) = 30 ' CVC2F(-6.666) = 20 ' CVC2F(-12.222) = 10 '/*------------------------------------------------------------------*/ FUNCTION CVC2F(BYVAL DEGC AS DOUBLE) PUBLIC AS DOUBLE CVC2F = DEGC * 1.8 + 32 END FUNCTION '/*------------------------------------------------------------------*/ ' CLS ' PRINT CVF2C(32);"--- 32" ' PRINT CVF2C(100);"---100" ' PRINT CVF2C(31);"--- 50" ' PRINT CVF2C(0);"--- 0" ' INPUT Z