CODE : Temprature Conversion

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu