Bug #18150 Updated: converting functions

From: Date: Wed, 03 Jul 2002 22:30:36 +0000
Subject: Bug #18150 Updated: converting functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13038@lists.php.net to get a copy of this message
ID: 18150 Updated by: sniper@php.net Reported By: hagman@byteme.com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Win Me PHP Version: 4.2.1 New Comment: Like you see, it's easy to do it in PHP. We don't really need to have these as builtin functions. (feel free to create an extension..or something.) Previous Comments: ------------------------------------------------------------------------ [2002-07-03 15:48:49] hagman@byteme.com There are some functions to convert time and BinDec etc in PHP but i feel that a whole bunch of functions are missing. for example Temperature Converting functions (eg. included). and for speed, mass, energy etc all of those. # From Celsius // To Fahrenheit function celfar($c) { return $c*1.8+32; } // To Kelvin function celkel($c) { return $c+273.15; } // To Rankine function celran($c) { return $c*1.8+491.67; } // To Réaumur function celrea($c) { return $c*0.8; } # From Fahrenheit // To Celsius function farcel($f) { return ($f-32)*(5/9); } // To Kelvin function farkel($f) { return ($f-32)*(5/9)+273.15; } // To Rankine function farran($f) { return $f+459.67; } // To Réaumur function farrea($f) { return ($f-32)*(4/9); } # From Kelvin // To Celsius function kelcel($k) { return $k-273.15; } // To Fahrenheit function kelfar($k) { return ($k-273.15)*9/5+32; } // To Rankine function kelran($k) { return $k*1.8; } // To Réaumur function kelrea($k) { return ($k-273.15)*0.8; } # From Rankine // To Celsius function rancel($r) { return ($r*(5/9))-273.15; } // To Fahrenheit function ranfar($r) { return $r-459.67; } // To Kelvin function rankel($r) { return $r*(5/9); } // To Réaumur function ranrea($r) { return ($r*(4/9))-218.52; } # From Réaumur // To Celsius function reacel($re) { return $re*1.25; } // To Fahrenheit function reafar($re) { return $re*2.25+32; } // To Kelvin function reakel($re) { return $re*1.25+273.15; } // To Rankine function rearan($re) { return $re*2.25+491.67; } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18150&edit=1

« previous php.bugs (#13038) next »