mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-20 00:38:23 +02:00
* Initial version
git-svn-id: trunk@4919 -
This commit is contained in:
parent
bb34d2fc32
commit
d3dfdffaa2
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -4840,6 +4840,7 @@ rtl/objpas/objpas.pp svneol=native#text/plain
|
|||||||
rtl/objpas/rtlconst.inc svneol=native#text/plain
|
rtl/objpas/rtlconst.inc svneol=native#text/plain
|
||||||
rtl/objpas/rtlconst.pp svneol=native#text/plain
|
rtl/objpas/rtlconst.pp svneol=native#text/plain
|
||||||
rtl/objpas/rtlconsts.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/strutils.pp svneol=native#text/plain
|
||||||
rtl/objpas/sysconst.pp svneol=native#text/plain
|
rtl/objpas/sysconst.pp svneol=native#text/plain
|
||||||
rtl/objpas/sysutils/dati.inc svneol=native#text/plain
|
rtl/objpas/sysutils/dati.inc svneol=native#text/plain
|
||||||
|
52
rtl/objpas/stdconvs.pp
Normal file
52
rtl/objpas/stdconvs.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user