snuwoods
04-07-2007, 01:05 AM
Hey-
First of all, does anyone know a function that will determine if a number is odd or not?
I think I've got a half-working script anyway.
The problem:var
z: Extended;
k: Integer;
const
x = 21;
begin
cleardebug;
z := x;
z := (z)*(0.5);
WriteLn(FloatToStr(z));
k := (Round(z));
WriteLn(FloatToStr(k));
k := (k-1);
WriteLn(IntToStr(k));
if(z>(k))and(z<(k+1))then
WriteLn('The Number is Odd')
else
WriteLn('The Number is Even');
end.
I think it just rounds z/2....not 10.5 or whatever else it is. Could someone just help me out here...ty :rolleyes:
Also, how does one go about naming the version of a script?
ty
--
snuwoods
First of all, does anyone know a function that will determine if a number is odd or not?
I think I've got a half-working script anyway.
The problem:var
z: Extended;
k: Integer;
const
x = 21;
begin
cleardebug;
z := x;
z := (z)*(0.5);
WriteLn(FloatToStr(z));
k := (Round(z));
WriteLn(FloatToStr(k));
k := (k-1);
WriteLn(IntToStr(k));
if(z>(k))and(z<(k+1))then
WriteLn('The Number is Odd')
else
WriteLn('The Number is Even');
end.
I think it just rounds z/2....not 10.5 or whatever else it is. Could someone just help me out here...ty :rolleyes:
Also, how does one go about naming the version of a script?
ty
--
snuwoods