### Numeric Operators(work in progress)

KEY:
In Development: This code is not ready to document.

Note: The symbols making up the operators should have no intervening white space. The symbol groupings (e.g. /+%) are called operators. Operators occurring adjacent to each other in code must be separated by white space. Glee matches up the longest sequence of symbols which identify an operator.

Operator Code Result
M + Signum (2.._2)\$ + 2 1 0 _1 _2
Result: 1 1 0 _1 _1
D + Plus 1 2 3 + (6 5 4) 7 7 7
M - Negate _2 0 3 - 2 0 _3
D - Minus 1 2 3 - (4 2 _2) _3 0 5
D * Times 1 2 3 * (4 5 6) 4 10 18
M / Reciprocal 1.1e2 110 0.5 / 0.00909091 0.00909091 2
D / Divided By 10 _2 30 /(2 3.1 1.2e3) 5 _0.645161 0.025
D << Smaller of 1 2 3 << (3 2 1) 1 2 1
M | Absolute value (2.._2) \$ | 2 1 0 _1 _2
2 1 0 1 2
D | Union 1..5 | (_2 2 4 8) _2 1 2 3 4 5 8
D >> Larger of 1 2 3 >> (3 2 1) 3 2 3
M % Fractional part 1.23 _1.23 3 % 0.23 _0.23 0
D % Modulo 3 2 1 0 _1 _2 _3 % 2 1 0 1 0 _1 0 _1
M & Unique 10 %% 10?10 =>x \$;
x &
6 5 4 9 10 10 2 8 3 10
2 3 4 5 6 8 9 10
D & Intersect (1..5) & (3..7) 3 4 5
D && Filter 10 %% 10 ? 10 =>n\$;
n && (2 4 6 8 10)\$;
6 5 4 9 10 10 2 8 3 10
6 4 10 10 2 8 10
D = Equality 1 2 3 = (1 2 3)\$;
1 4 3 = (1 2 3)\$;
1 2 3 = (1 2 3 4)\$;
1
0
0
D *< Mark Elements LT 1 2 3 4 *< (1 5 4) %** Bit[I65R1C4:B]0010
D *<= Mark Elements LE 1 2 3 4 *<= (1 5 4) %** Bit[I137R1C4:B]1011
D *= Mark Elements EQ 1 2 3 4 *= (1 5 4) %** Bit[I209R1C4:B]1001
D *>= Mark Elements GE 1 2 3 4 *>= (1 5 4) %** Bit[I281R1C4:B]1101
D *> Mark Elements GT 1 2 3 4 *> (1 5 4) %** Bit[I353R1C4:B]0100
D *~= Mark Elements NE 1 2 3 4 *~= (1 5 4) %** Bit[I65R1C4:B]0110
M %- Half Round #nil ,1.51 1.5 1.49 1.1
1.0 0.99 =>x;
'<0>'(x) \$;
'<1>'(x %-) \$;
'<2>'(x- %-) \$;

<0>Nil 1.51 1.5 1.49 1.1 1 0.99
<1>Nil 2 2 1 1 1 1
<2>Nil _2 _2 _1 _1 _1 _1
D %- Near Round 100/7 =>x; '
<0>'(x) \$;
'<1>'(x %- (.5 .05 .0025 3) ) \$;
'<2>'(x- %- (.5 .05 .0025 3) ) \$;

<0>14.2857
<1>14.5 14.3 14.285 15
<2>_14.5 _14.3 _14.285 _15
M %\ Floor #nil ,2.1 2 1.9 1.1 0 .9 =>x;
'<0>'(x) \$;
'<1>'(x %\) \$;
'<2>'(x- %\) \$;

<0>Nil 2.1 2 1.9 1.1 0 0.9
<1>Nil 2 2 1 1 0 0
<2>Nil _2 _2 _1 _1 0 0
D %\ Nearest Lower 100/7 =>x;
'<0>'(x) \$;
'<1>'(x %\ (.5 .05 .0025 3) ) \$;
'<2>'(x- %\ (.5 .05 .0025 3) ) \$;

<0>14.2857
<1>14 14.25 14.285 12
<2>_14 _14.25 _14.285 _12
M %/ Ceiling #nil ,2.1 2 1.9 1.1 0 .9 =>x;
'<0>'(x) \$;
'<1>'(x %/) \$;
'<2>'(x- %/) \$;

<0>Nil 2.1 2 1.9 1.1 0 0.9
<1>Nil 3 2 2 2 0 1
<2>Nil _3 _2 _2 _2 0 _1
D %/ Nearest Higher 100/7 =>x;
'<0>'(x) \$;
'<1>'(x %/ (.5 .05 .0025 3) ) \$;
'<2>'(x- %/ (.5 .05 .0025 3) ) \$;
2.34 2.34 _2.32 _2.34
M \+ Sum 10 20 30\+ 60
M \+% Average 10 20 30\+% 20
M \* Product 10 20 30\* 6000
M \<< Smallest 10 20 30\<< 10
M \>> Largest 10 20 30\>> 30
M \- Median 1000->1000? \-
499
In development
M \= Mode 1000->1000? =>r # \$;
r \= =>mode \$;
r=mode \+ \$;
1000
387
4
In development
D *+ Compounding 1000 900 1100=>a;
1.07 1.06 1.05=>i;
a *+ i
1070 2088.2 3347.61
M /+ Running Total 10 20 30/+ 10 30 60
D /+ Moving Sum 10 20 30 40/+ 2 10 30 50 70
M /* Running Product 1.1 1.1 1.1/* 1.1 1.21 1.331
D /* Moving Product 4 5 3 7 7 6/100+1 /* 2 1.04 1.092 1.0815 1.1021 1.1449 1.1342
M /<< Running Smallest 10 15 5 23 2 8/<< 10 10 5 5 2 2
D /<< Moving Smallest 10 15 5 23 2 8 7 /<< 3 10 10 5 5 2 2 2
M />> Running Largest 10 15 5 23 2 8/>> 10 15 15 23 23 23
D />> Moving Largest 10 15 5 23 2 8 7 />> 3 10 15 15 23 23 23 8
M /+% Running Average 10 20 30 40/+% 10 15 20 25
D /+% Moving Average 10 20 30 40/+% 2 10 15 25 35
M /+%% Total Ratio 9 5 12 /+%% =>x \$;
x \+
0.346154 0.192308 0.461538
Result: 1
M -- First Difference 1 1.2 1.1 .9 1.1 -- 0 0.2 _0.1 _0.2 0.2
D -- N-Difference 1 2 3 2 5 -- 2 0 0 2 0 2
D %> Base 2 10 48 %> (24 60 60) 7848
D %< Rep 7848 %< (24 60 60) 2 10 48
M ! Factorial 8! 40320
D n ! r Combinations 4 ! 2,,\ 1 2
1 3
2 3
1 4
2 4
3 4
D n #! r Number of Combinations 4 #! 2 6
D n !! r Permutations 4 !! 2 ,,\ 1 2
1 3
...
...
4 2
4 3
D n #!! r Number of Permutations 4 #!! 2 12
N ^ e ^ 2.71828
M ^ Power of e 1 2 3^ 2.71828 7.38906 20.0855
D ^ Power 10 9 ^ (2 .5) 100 3
M #LN Natural Log 1 2 3 ^ \$ #LN 2.71828 7.38906 20.0855
1 2 3
D #LN Log base N 5 ^ (1 2 3) \$ #LN 5 5 25 125
1 2 3
M #LOG Common Log 10 ^ (1 2 3) \$ #LOG 10 100 1000
1 2 3
D #LOG Log base N 2 ^ (1 2 3) \$ #LOG 2 2 4 8
1 2 3