Say i have a possibility of getting a negative after subtracting. And I want to turn that negative into the positive version.
Example.
4-6 = -2, script to turn -2 into 2.
Say i have a possibility of getting a negative after subtracting. And I want to turn that negative into the positive version.
Example.
4-6 = -2, script to turn -2 into 2.
I do visit every 2-6 months
Use Abs(). Just note that it takes an extended and gives back an extended.
I := i + (i * -2)
it should work, in theory
edit....... wow:
i := i * -1;
ftw.SCAR Code:iAbs(number : integer) : integer
Oh and btw, you will never get a negative number if you are subtracting a negative from a positive...
SCAR Code:begin
Writeln(IntToStr(iAbs(50 + -55)));
end.
Last edited by Da 0wner; 05-24-2009 at 06:49 AM.
Could be like
If Num < 0 then
Num := Num * -1;
Originally Posted by irc
Last edited by ZephyrsFury; 05-24-2009 at 01:53 PM.
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
meh i was using
SCAR Code:writeln(ABs(strtofloat(inttostr(locations.x - ThePoint.x)))
general walking towards an object within distance with no set path with reflection ftw!
I do visit every 2-6 months
okok, im using iabs now.![]()
I do visit every 2-6 months
well.. iabs would work, and for anyone who cares, here is the mathematical way:
Sqrt(Sqr(a - b))
~RM
Mines the best!
Originally Posted by irc
There are currently 1 users browsing this thread. (0 members and 1 guests)