SRL Archive - SRL Archives

Pythagorean Triad


XxKanexX

2006-03-05 04:56:29


function Triad(a, b, c: extended): boolean;
Var
Total: Integer;
begin
total:= Trunc( Sqr(MaxE(MaxE(a, b), MaxE(b, c))) );
if(Trunc(Sqr(MinE(a, b) + MinE(b, c))) = Total)then
result:= true;
end;

Is it worth adding?.. Or not needed ;)

Cheesehunk

2006-03-05 12:00:06

Hmmm, weird, I was juts learning this in school last week!
Haha, I think it would be worth it?

Renax

2006-03-05 12:22:43

what can it be used for ?

Lorax

2006-03-05 13:51:01

From: Renax
what can it be used for ?

Well let me give you one example, maybe if you were working with the solar system and wanted to know if the work you done with Eratosthenes observations is correct?

XxKanexX

2006-03-05 15:23:06

From: Lorax
Well let me give you one example, maybe if you were working with the solar system and wanted to know if the work you done with Eratosthenes observations is correct?

Exactly!

Now, this will be perfect when runescape makes a new world called space ;D