CODE : Temprature Conversion
- Posted by Mathew Hounsell <mat.hounsell at MAILEXCITE.COM> Jun 10, 1998
- 736 views
Carl R. White sent the following functions to the list : function FtoC(atom farenheit) return (farenheit - 32) / 1.8 end function function CtoF(atom celcius) -- or centigrade if you want return celcius * 1.8 + 32 end function Here are 4 functions to complement these, K stands for Kelvin (Standard Unit for Temperature) a system that starts at absolute zero and uses the same scale as Celcius. function CtoK(atom celcius) return celcius - 273 end function function FtoK(atom farenheit) return ( (farenheit - 32) / 1.8 ) - 273 end function function KtoC(atom kelvin) return kelvin + 273 end function function KtoF(atom Kelvin) return ( celcius + 273) * 1.8 + 32 end function --- Sincerely, Mathew Hounsell Mat.Hounsell at mailexcite.com Free web-based email, Forever, From anywhere! http://www.mailexcite.com