@@ -9,6 +9,17 @@ sort: 8
99From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
1010
1111```
12+def i(def a) {
13+ a.class in [
14+ byte, Byte,
15+ char, Character,
16+ short, Short,
17+ int, Integer,
18+ long, Long,
19+ BigInteger
20+ ] && a >= 0
21+}
22+
1223def n(def a) {
1324 if (a in List) {
1425 if (a.size() == 1) {
@@ -20,15 +31,15 @@ def n(def a) {
2031 } else {
2132 throw new IllegalStateException()
2233 }
23− } else if (a in Integer && a >= 0) {
24− a
34+ } else if (i(a)) {
35+ (BigInteger) a
2536 } else {
2637 throw new IllegalStateException()
2738 }
2839}
2940
3041def wut(def a) {
31− a in Integer ? 1 : 0
42+ i(a) ? 1 : 0
3243}
3344
3445def lus(def a) {
@@ -50,7 +61,7 @@ def fas(def a) {
5061 throw new IllegalStateException()
5162 }
5263 def h = a[0]
53− if (!(h in Integer)) {
64+ if (!i(h)) {
5465 throw new IllegalStateException()
5566 }
5667 def t = a[1]
@@ -59,18 +70,19 @@ def fas(def a) {
5970 } else if (h == 1) {
6071 t
6172 } else {
62− if (t in Integer) {
73+ if (i(t)) {
6374 throw new IllegalStateException()
64− } else if (h == 2) {
75+ }
76+ if (h == 2) {
6577 t[0]
6678 } else if (h == 3) {
6779 t[1]
6880 } else {
69− def i = h.intdiv(2)
81+ def x = h.intdiv(2)
7082 if (h.mod(2) == 0) {
71− fas([2, fas([i, t])])
83+ fas([2, fas([x, t])])
7284 } else {
73− fas([3, fas([i, t])])
85+ fas([3, fas([x, t])])
7486 }
7587 }
7688 }