Math Identifiers
mIRC Code
+ 2 likes
Please Register to submit score.
| Average Score | 7.0 (of 1 scores) |
| Date Added | Jan 30, 2009 |
| Last Updated | Jan 31, 2009 |
| Tags | constants functions identifiers math |
Introduction
It has:
$ispo(N): Returns $true if N is a positive number
$isneg(N): Returns $true if N is a negative number
$average(N1 N2 N3...): Returns the average of the series (Separated by a space)
$max(N1 N2 N3...): Returns maximum number from a series (Separated by a space)
$min(N1 N2 N3...): Returns minimum number from a series (Separated by a space)
$e: Returns the mathematical constant for e. (useful in things like a natural logarithm)
$logb(N,B): Returns logarithm of N with base B
$factor(N): Returns a list of factors for N (must be greater than 3)
$angle(N): Returns a conversion from either degree-radians or radians-degree. The desired output should be used as the property. (e.g. $angle(5pi).degree)
New:
$even(N): Returns true if N is even
$odd(N): Returns true if N is odd.
$nDeriv(N,f(x)): Returns the derivative at N from the equation f(x). Also assuming f(x) is derivable at that point. (e.g. $nDeriv(2,x^2) will give you 4)
I do take requests! So please if you have any more, do share so I can add to this.
Thanks:
korvin
mIRC Snippet:
Math Identifiers
Posted on Jan 30, 2009 7:47 pm
Posted on Jan 30, 2009 7:47 pm
Alot of these could be consolidated.
| Code: |
| alias ispos { return $iif($1 > 0,$true,$false) } alias isneg { return $iif($1 < 0,$true,$false) } alias average { return $calc(($replace($1,$chr(32),+)) / $numtok($1,32)) } alias min { return $gettok($sorttok($1,32,n),1,32) } alias max { return $gettok($sorttok($1,32,nr),1,32) } |
mIRC Snippet:
Math Identifiers
Posted on Jan 30, 2009 8:00 pm
Posted on Jan 30, 2009 8:00 pm
Is this like an IRC Calculator? Or what is it..?
mIRC Snippet:
Math Identifiers
Posted on Jan 30, 2009 8:06 pm
Posted on Jan 30, 2009 8:06 pm
@bluepower: Not really. Just adds some more identifiers to work with.
@TheImrac: Hmm, I'll update those. I've had those for quite a while so I didn't really update those.
Edit: I realize now why I didn't use something like your $max identifier.
If you do something like $max($ip a 21 13) = $ip
$min($ip a 21 13) = a
@TheImrac: Hmm, I'll update those. I've had those for quite a while so I didn't really update those.
Edit: I realize now why I didn't use something like your $max identifier.
If you do something like $max($ip a 21 13) = $ip
$min($ip a 21 13) = a
mIRC Snippet:
Math Identifiers
Posted on Jan 30, 2009 8:08 pm
Posted on Jan 30, 2009 8:08 pm
Oh BTW technically, 0 could be postive or negative. so you might want to do >= and <=, but I wasn't sure.
mIRC Snippet:
Math Identifiers
Posted on Jan 31, 2009 2:25 am
Posted on Jan 31, 2009 2:25 am
well.. i cant remember if there is an even/odd feature with mirc
| Code: |
| alias even { return $iif($1 // 2,$true,$false) } alias odd { return $iif($1 \\ 2,$true,$false) } |
mIRC Snippet:
Math Identifiers
Posted on Jan 31, 2009 5:07 pm
Posted on Jan 31, 2009 5:07 pm
Korvin, the $1 and 2 should be switched, good addition though:
| Code: |
| alias even { return $iif(2 // $1,$true,$false) } alias odd { return $iif(2 \\ $1,$true,$false) } |
mIRC Snippet:
Math Identifiers
Posted on Jan 31, 2009 7:42 pm
Posted on Jan 31, 2009 7:42 pm
Added and fixed. Thanks.
Any other ones?
Added:
$even
$odd
$nDeriv
Any other ones?
Added:
$even
$odd
$nDeriv
mIRC Snippet:
Math Identifiers
Posted on Feb 23, 2009 12:21 pm
Posted on Feb 23, 2009 12:21 pm
$pi <- a hidden id in mirc return the pi number.
3.14159265358979323846
xD
3.14159265358979323846
xD
| Code: |
;- prop's ; cir -> with a diameter get a perimeter of a circle (diam) ; rad -> with a radius get a perimeter of the diameter ; sqr -> perimeter of a square with a side. ;- no prop -> get any perimeter of a polygon. ;- - - - - - - - - by dashh xD alias perimeter { if ( $prop = cir ) { return $calc($1 * $pi) } if ( $prop = rad ) { return $calc((2 * $pi) * $1) } if ( $prop = sqr ) { return $calc(4 * $1 ) } return $calc($replace($remove($1-,+,-),$chr(32),$chr(43))) } |








