diff --git a/.gitattributes b/.gitattributes index 4fee894b4d..cc564f170d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4840,6 +4840,7 @@ rtl/objpas/objpas.pp svneol=native#text/plain rtl/objpas/rtlconst.inc svneol=native#text/plain rtl/objpas/rtlconst.pp svneol=native#text/plain rtl/objpas/rtlconsts.pp svneol=native#text/plain +rtl/objpas/stdconvs.pp svneol=native#text/plain rtl/objpas/strutils.pp svneol=native#text/plain rtl/objpas/sysconst.pp svneol=native#text/plain rtl/objpas/sysutils/dati.inc svneol=native#text/plain diff --git a/rtl/objpas/stdconvs.pp b/rtl/objpas/stdconvs.pp new file mode 100644 index 0000000000..4925387746 --- /dev/null +++ b/rtl/objpas/stdconvs.pp @@ -0,0 +1,52 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2004 by Marco van de Voort + member of the Free Pascal development team. + + An implementation for unit stdconv, + + Based on list of function of delphibasics.co.uk and #7482. + + Quantities are mostly taken from my HP48g/gx or the unix units program + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY;without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +**********************************************************************} + +unit stdconvs; + +interface + +{$mode objfpc} +{$H+} + +function CelsiusToFahrenheit(const AValue: Double): Double; +function FahrenheitToCelsius(const AValue: Double): Double; +function CelsiusToKelvin (const AValue: Double): Double; +function KelvinToCelsius (const AValue: Double): Double; + +implementation + +function FahrenheitToCelsius(const AValue: Double): Double; +begin + result:= 32.0 + ((9.0 * AValue)/ 5.0); +end; + +function CelsiusToFahrenheit(const AValue: Double): Double; +begin + result:= (5.0/9.0) * (Avalue - 32.0); +end; + +function CelsiusToKelvin (const AValue: Double): Double; +begin + result:=AValue+273.15; +end; + +function KelvinToCelsius (const AValue: Double): Double; +begin + result:=AValue-273.15; +end; + +end.