17.09.2011, 04:06
(
Последний раз редактировалось Lorenc_; 17.09.2011 в 08:56.
)
A math include for problem solving..
I thought about it, and I was thinking is there any ways I could do equations more tidier? Well I here made this for myself thought since I don't always use it, I would share it among the community :P
You may seem to think it's useless but hey, works fine for me and does a superb job for me. Some functions return decimals (such as floats) and some return whole numbers. So make sure you check what you're doing!
There are 17 functions all related to numbers (or in other words, math). I managed to make a function relating to some mathematical theorems. Though the new 6 basic functions, plus, minus, times, divide, sqroot, power. They haven't been fully tested but if there is problems with it, please do report it here.
Functions
pawn Код:
/*
native Math.Pi()
native Math.Infinite()
native Math.Highest(...)
native Math.Add(val, val2)
native Math.Subtract(val, val2)
native Math.Divide(val, val2)
native Math.Multiply(val, val2)
native Math.SquareRoot(Value)
native Math.Power(val, val2)
native Math.Mean(...)
native Math.Pythagoras( Float: val1, Float: val2, bool: shortside = false )
native Math.GetMiddlePos(Float: X, Float: Y, Float: X2, Float: Y2, &Float: vX, &Float: vY)
native Math.RandomEx(min, max)
native Math.RandomPlayer()
native Math.IsPositive( num )
native Math.IsNegative( num )
native Math.Random3DCoord( Float: minx, Float: miny, Float: minz, Float: maxx, Float: maxy, Float: maxz, &Float: randx, &Float: randy, &Float: randz)
*/
Yes I know, they're also in functions. Please don't complain about me converting them to defines/macros.
Credits
Mauzen - Arithmetic mean value.
Lorenc - Most of the functions
RyDeR` - RandomEx calculation
[HiC]TheKiller - Minor fixes/help
Logs
Код:
** Released Fixed several things listed - <<
Ask RyDeR` for mathematic problems lol, his a mathematician pro!
Download
Version 1.1
Problems/Suggestions?
Please do bump the thread with suggestions, would be more than welcome to add them
Problems? Please post here so I can fix them as soon as possible.
I will update the thread for new functions and bug fixes, so stay tuned.