![]() Commands for:
|
The functions of the
CALC command are not dissimilar to those of a professional scientific
calculator, with a focus on more commonly observed mathematic
principles. Intent The calc command is
used to evaulate any valid expression given to the bot and will
return the result to the channel in which the command was used.
If the command was used via msg, the bot will then return the
result to the user via notice. Usage The command may be issued in one of two ways.
botnick calc expression Arguments A valid expression may include
Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operands may be applied to string operands, and bit-wise NOT may be applied only to integers.
Multiply, divide, remainder. None of these operands may be applied to string operands, and remainder may be applied only to integers. The remainder will always have the same sign as the divisor and an absolute value smaller than the divisor.
Add and subtract. Valid for any numeric operands.
Left and right shift. Valid for integer operands only. A right shift always propagates the sign bit.
Boolean equal and not equal. Each operator produces a zero/one result. Valid for all operand types.
Bit-wise AND. Valid for integer operands only.
Bit-wise exclusive OR. Valid for integer operands only.
Bit-wise OR. Valid for integer operands only.
Logical AND. Produces a 1 result if both operands are non-zero, 0 otherwise. Valid for boolean and numeric (integers or floating-point) operands only.
Logical OR. Produces a 0 result if both operands are zero, 1 otherwise. Valid for boolean and numeric (integers or floating-point) operands only.
If-then-else. If x evaluates to non-zero, then the result is the value of y. Otherwise the result is the value of z. The x operand must have a numeric value.
|