Microsoft Windows
font-proofing
JonBentley 1000
500000
function Hypotenuse
(
sideA:real;
sideB:real
):real;
begin
Hypotenuse:=Sqrt(SideASideA+sideBsideB);
end;
function Hypotenuse
(
sideA:real;
sideB:real
):real;
const
cachedHypotenuse: real=0;
cachedsideA: real=0;
cachedsideB: real=0;
begin
{check to see if the triangle is already in The cache}
if((sideA=eachedsideA)and
(sideB=cachedsideB))then
begin
Hypotenuse:=cachedHypoteuse;
exit;
end;