Archive: Math Plugin codes


Math Plugin codes
I made a matrix code sum, but it doesn't work, it exits the MathTest program with a windows error, what is wrong in this code?

Matrix(a, b) = (c = 0; #[l(a) >= l(b), d = l(a) - 1, d = l(b) - 1]; #{c++ <= d, x[c] = (a[c] + b[c])})


(I'm trying to do more codes for Math Plugin to do basic calculators calculations like Permutation (nPr) or some others I found useful, like a code to round the number automatically, just putting what digit after dot to round and the number to round)

Matrix(a,b) (c=-1; x={}; d=#[l(a)>l(b), l(a), l(b)]; #{c++<d, x[c]=a[c]+b[c]}; x)

tips:
1. no = needed between Matrix() and ().
2. x array should be declared before use.
3. if you'd like x to be the function output, place it as last expression.


Thanks! Your plugin rocks! I will get a look in it in my home.

(OUT OF TOPIC: Great idea to put a subforum for NSIS translations, but I have other idea, to put subforum for NSIS Plugins too)


Originally posted by deguix
(OUT OF TOPIC: Great idea to put a subforum for NSIS translations, but I have other idea, to put subforum for NSIS Plugins too)
I agree it would be a good idea to create sub-forums for all sorts of subjects, but there doesn't seem to be a need currently. There is not so much in here anyway... Thinking about it again, I don't know why we decided to create a sub forum for languages and not keep it here as it has even less discussion than plug-ins.

Oh, almost forgot... Yay for the calculator plug-in :D

The reason why there is a subforum for languages is that there can be separate topics for languages without having a lot of topics that are useless for most people.

It's also good that these topics are easy to find, because language questions can only be answered by the translators, so it will usually take longer.