=(Expression) - Wireless4024/DiscordBot GitHub Wiki

=(Expression)
used to calculate big number which support range up to 2,000,000,000 bits and precision up to 1900 digits because discord limit message length to 2000

Example:

=1+1+2**8+9+7<<4

is

4384

or

=1+1+2**8+9+7<<4

is

4384

Functions and Operators listed below

Note :

  • Variable name and function name are ignore case
  • Operator priority are same with C Operator Precedence

Pre-defined value

name value
pi 3.1415..
e 2.7182..

Note :
digit length is same as precision

Basic Operator

Operator Description Example Result
+ Plus / Add 8 + 3 11
- Minus / Subtract 8 - 3 2
* Times / Multiply 8 * 3 24
/ Divide / Division 8 / 3 2.6666
// Floor divide 8 // 3 2
% Modulo 8 % 3 2
** Exponent 8 ** 3 512
= Assign x = 8 8
x * x 64

Bitwise Operator

Operator Description Example Result
<< ShiftLeft 8 << 3 64
0.25 << 2 1
>> ShiftRight 8 >> 3 1
1 >> 2 0.25
& Bit AND* 8 & 3 0
| Bit OR* 8 | 3 11
^ Bit XOR* 8 ^ 3 11
~ Bit NOT* ~8 -9
~& Bit NAND* 8~&3 -1
~| Bit NOR* 8 ~| 3 -12
~^ Bit NXOR* 8 ~^ 3 11

Note :
* round into integer


Logical Operator

Operator Description Example Result
== Equals 1 == 1 1
!= Not Equals 1 != 1 0
> Greater than 1 > 1 0
>= Greater or Equals 1 >= 1 1
< Less than 1 < 1 0
<= Less or Equals 1 <= 1 1
|| OR 1 || 0 1
&& AND 1 && 1 1

Note :

  • return 1 if true else false

Functions

Name Description Parameter(s) Example Result Full function name
abs absolute value 1 abs(-8) 1 -
acos arc cosine 1 acos(0.5) 1.04719 -
acosh arc hyperbolic cosine 1 acosh(20) 3.68825 -
asin arc sine 1 asin(0.5) 0.52359 -
asinh arc hyperbolic sine 1 asinh(20) 3.68950 -
atan arc tangens 1 atan(0.5) 0.46364 -
atanh arc hyperbolic tangens 1 atanh(0.5) 0.54930 -
ceil round with ceiling 1 ceil(2.5) 3 -
cos cosine 1 cos(2.5) -0.8011 -
cosh hyperbolic cosine 1 cosh(2.5) 6.13228 -
cube third power 1 cube(2) 8 -
fac* factorial 1 fac(8) 40.32E+3 factorial
8! 40.32E+3 -
fib fibonacci 1 fib(5) 5 fibonacci
floor round with floor 1 floor(2.5) 2 -
gamma gamma 1 gamma(8) 5.04E+3 -
gauss random between 0 to 1 0 gauss() 0.76516242 gaussian
with digits count 1 gauss(4) 0.9674 -
if if(statement**,true,false) 3 if(1>0,2,3) 2 -
log logarithm 1 log(10) 2.302585 -
log2 binary logarithm 1 log2(10) 3.321928 -
log10 common logarithm 1 log10(20) 1.301029 -
max find max number 1 to any max(1,2,3) 3 -
min find min number 1 to any min(1,2,3) 1 -
rand random(max, min=0, scaleMax=0, scaleMin=0) 1 to 4 rand(50) any random
root find n th root of number 2 root(5,3) 1.709975 -
round round number with default rounding 1 round(5.6) up to rounding mode -
sin sine 1 sin(5) -0.95892 -
sinh hyperbolic sine 1 sinh(5) 74.20321 -
sqr square 1 sqr(5) 25 square
sqrt square root 1 sqrt(5) 2.236067 squareroot
sum sum given number 1 to any sum(1,2,3) 6 -
sumn sum number from 1,2..n 1 sumn(50) 1275 -
tan tangens 1 tan(5) -3.38051 -
tanh hyperbolic tangens 1 tanh(5) 0.999909 -

Note :
* can be use as number! like 5! is fac(5)
** if number is not zero mean true else false