mIRC Home    About    Download    Register    News    Help

Print Thread
#9157 01/02/03 01:15 AM
Joined: Feb 2003
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Feb 2003
Posts: 2
I suggest that with $calc you support "factorials"

ex:
$calc(10!)
would return the same as
$calc(10*9*8*7*6*5*4*3*2*1)

As you can see it cuts down on the work you have to input to $calc.

http://www.factmonster.com/ipka/A0875935.html for more information


if ($you == stupid) {
while ($you == stupid) {
slap $you
}
}
Joined: Dec 2002
Posts: 212
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
I'm pretty sure most of us know what factorial is ;b
Bur can you tell a reason why to add it?
After all it easily enough to script it, and I can see much use for it
New additions are not bad, but I hope you realize that Khaled will not add every single requested feature, especialy things that will have no or very little use
for example I would die to see Dirac's delta function implemented smile


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
alias math::factorial { if ($1 == 0) return 1 | if ($1 > 35) return $null | var %total = 1, %cur = $1 | while (%cur > 1) { %total = %total * %cur | dec %cur } | return %total }

The max of 35 is cause $calc() is broken and can't do math on exponential numbers.


Link Copied to Clipboard