m |
(→See Also: moar math) |
||
Line 55: | Line 55: | ||
== See Also == | == See Also == | ||
* {{mIRC|$abs}} | * {{mIRC|$abs}} | ||
+ | * {{mIRC|$and}} | ||
* {{mIRC|$acos}} | * {{mIRC|$acos}} | ||
* {{mIRC|$asin}} | * {{mIRC|$asin}} | ||
* {{mIRC|$atan}} | * {{mIRC|$atan}} | ||
+ | * {{mIRC|$atan2}} | ||
* {{mIRC|$base}} | * {{mIRC|$base}} | ||
+ | * {{mIRC|$biton}} | ||
+ | * {{mIRC|$bitoff}} | ||
* {{mIRC|$ceil}} | * {{mIRC|$ceil}} | ||
* {{mIRC|$cos}} | * {{mIRC|$cos}} | ||
+ | * {{mIRC|$cosh}} | ||
+ | * {{mIRC|$floor}} | ||
+ | * {{mIRC|$hypot}} | ||
+ | * {{mIRC|$int}} | ||
+ | * {{mIRC|$intersect}} | ||
+ | * {{mIRC|$isbit}} | ||
+ | * {{mIRC|$log}} | ||
+ | * {{mIRC|$log10}} | ||
+ | * {{mIRC|$not}} | ||
+ | * {{mIRC|$or}} | ||
+ | * {{mIRC|$pi}} | ||
+ | * {{mIRC|$round}} | ||
* {{mIRC|$sin}} | * {{mIRC|$sin}} | ||
+ | * {{mIRC|$sinh}} | ||
+ | * {{mIRC|$sqrt}} | ||
* {{mIRC|$tan}} | * {{mIRC|$tan}} | ||
+ | * {{mIRC|$tanh}} | ||
+ | * {{mIRC|$xor}} | ||
{{mIRC identifier list}} | {{mIRC identifier list}} | ||
[[Category:mIRC identifiers|calc]] | [[Category:mIRC identifiers|calc]] |
Revision as of 16:05, 27 September 2017
$calc can be used to perform mathematical calculations from the mIRC command line, or from inside of a custom script.
Synopsis
$calc(operations)
The $calc adheres to mathematical standards set forth by the order of operations. Therefore, a combination of brackets and parentheses can be used in order to manipulate the order of operations. $calc can also be used to calculate variables in mIRC, as well as other customer identifiers that return numerical values.
Parameters
operationsThese are a specific set of mathematical operations for $calc to perform.
Operators
+Addition
-Subtraction
*Multiplication
/Division
//Floor division, same as $floor($calc(X / Y))
^Exponent
Examples
Echo a simple addition calculation to the active window
//echo -a $calc(3 + 5)
Echo a manipulated order of operations calculation to the active window
//echo -a $calc(3 * 4 * (3 + 5)))
Echo the remainder of the calculation, by invoking the modulus operator, to the active window
//echo -a $calc(10 % 3)
Create a simple alias to take in two parameters, then raise the first to the power of the second, and return the value
alias power { ; Make sure both inputs are numbers if (($1 isnum) && ($2 isnum)) { return $calc($1 ^ $2) } }
The above $power alias can now be used like so:
//echo -a $power(2,2)
The result of the above command would be:
4
Compatability
Added: mIRC v5.1
Added on: 28 Aug 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See Also
- $abs
- $and
- $acos
- $asin
- $atan
- $atan2
- $base
- $biton
- $bitoff
- $ceil
- $cos
- $cosh
- $floor
- $hypot
- $int
- $intersect
- $isbit
- $log
- $log10
- $not
- $or
- $pi
- $round
- $sin
- $sinh
- $sqrt
- $tan
- $tanh
- $xor