SRL Archive - Other Scripts

Calculate Sqrt


SKy Scripter

2007-12-18 01:14:22

Lol, Got Bored and made a Sqrt function….
its pretty accurate… i would like it to be more dead on.. but yea XD
its pretty cool


program new;
var Pn: array [1..1000] of Extended;


procedure LoadSqrt;
var i: Integer;
begin
for i := 1 to 1000 do pn[i] := Sqr(I);
end;


function sqrt2(x: Extended): Extended;
var I, N: Integer;
e1, e2, e3: extended;
begin
for i:= 1 to 1000 do
if (pn[i] > x) then
begin
n := i;
break;
end;

e1 := x / n;
e2 := (e1 + n) div 2;

while (abs(sqr(e2) - x) > 0.0000001) do
begin
e3 := (x / e2)
e2 := (e2 + e3) / 2;
end;

Result := e2;
end;


var k: Integer;
begin
LoadSqrt;
for k:= 1 to 100 do
Writeln(Floattostr(sqrt2(k)));
end.


not much its just fun XD, you can use this method if you don't have a calculator i guess

mastaraymond

2007-12-18 15:28:46

From: SKy Scripter
Lol, Got Bored and made a Sqrt function….
its pretty accurate… i would like it to be more dead on.. but yea XD
its pretty cool
not much its just fun XD, you can use this method if you don't have a calculator i guess


No leaving for you? :rolleyes:

Lol, yeah brute forcing it, kinda cool ^^.. I wonder how the Processors do it..

SKy Scripter

2007-12-18 15:58:26

From: mastaraymond
No leaving for you? :rolleyes:

Lol, yeah brute forcing it, kinda cool ^^.. I wonder how the Processors do it..


Well, the thing is i dont know if im like "Leaving Leaving"
however, im retired for SRL :p

ill bet the processors do it similar

King of Knives

2007-12-18 16:31:28

I compilation of quotes showing a breathtaking secret. Combined by our reporter stationed in SRL. House of the nerds and geeks (No offence to anybody).

From: SKy Scripter
you can use this method if you don't have a calculator i guess


array [1..1000] of Extended;
EVIDENCE 1: SKy can store 1000 indexes in his head.

From: mastaraymond
I wonder how the Processors do it..

From: SKy Scripter
ill bet the processors do it similar


Conclusion: SKy Scripter is, in fact, a computer processor.

-On topic below-
I have absolutely no idea how processors do it :D But this way actually could be an answer :D

-Knives

Hugolord

2007-12-18 16:36:20

From: King of Knives
I compilation of quotes showing a breathtaking secret. Combined by our reporter stationed in SRL. House of the nerds and geeks (No offence to anybody).



array [1..1000] of Extended;
EVIDENCE 1: SKy can store 1000 indexes in his head.




Conclusion: SKy Scripter is, in fact, a computer processor.

-On topic below-
I have absolutely no idea how processors do it :D But this way actually could be an answer :D

-Knives

ROFL!! :p

nice tho SKy ^^ =)

SKy Scripter

2007-12-18 17:01:07

From: King of Knives
I compilation of quotes showing a breathtaking secret. Combined by our reporter stationed in SRL. House of the nerds and geeks (No offence to anybody).



array [1..1000] of Extended;
EVIDENCE 1: SKy can store 1000 indexes in his head.




Conclusion: SKy Scripter is, in fact, a computer processor.

-On topic below-
I have absolutely no idea how processors do it :D But this way actually could be an answer :D

-Knives


Lol, i would be happy if i was a processor :)

mastaraymond

2007-12-18 17:04:58

From: SKy Scripter
Lol, i would be happy if i was a processor :)

Wow, i wouldn't.. I would be really hot the whole time.. Oh noes.

SKy Scripter

2007-12-18 17:10:43

From: mastaraymond
Wow, i wouldn't.. I would be really hot the whole time.. Oh noes.


if you were a processor i would make sure i put viruses on you…
or i would take out all your ram :)..


Me on the other hand, i would be a robot, with Artificial intelligence's…
Able to feel, taste, touch, eat and do anything a human can.. but more :p

mastaraymond

2007-12-18 17:12:28

From: SKy Scripter
if you were a processor i would make sure i put viruses on you…
or i would take out all your ram :)..


Me on the other hand, i would be a robot, with Artificial intelligence's…
Able to feel, taste, touch, eat and do anything a human can.. but more :p


Fucking 24/7.. Naughty.

SKy Scripter

2007-12-18 17:17:05

From: mastaraymond
Fucking 24/7.. Naughty.


Ouch…. :eek: Oh Wellz… :)

Nvm, i don't think i would want to be robot… anymore….
Maybe Like a Robot Brain instead… Programmed By God Him Self and all hes knowledge :)

mastaraymond

2007-12-18 17:48:37

From: SKy Scripter
Ouch…. :eek: Oh Wellz… :)

Nvm, i don't think i would want to be robot… anymore….
Maybe Like a Robot Brain instead… Programmed By God Him Self and all hes knowledge :)


Lol

I keep getting this ad when there is something like "Love,Fucking" in the thread:

goider

2007-12-19 07:25:38

hehehe, i just use a calc….. its on my cell. i think you should make a clalc similar to windows with forms!!!! but include this and others so make a scientific CALC!!!