diff options
author | Marvin Borner | 2024-07-27 20:32:48 +0200 |
---|---|---|
committer | Marvin Borner | 2024-07-27 20:32:48 +0200 |
commit | 6ad85ef29f7da7846ccc779c7c2a192b4db301b1 (patch) | |
tree | ba987e739ffc92182d9692da176071e3742fe2db /std/Number | |
parent | 1d20e2a89a9dbae670d813d90e50f44b3f1dbd91 (diff) |
Some accumulated math changes
Diffstat (limited to 'std/Number')
-rw-r--r-- | std/Number/Unary.bruijn | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/std/Number/Unary.bruijn b/std/Number/Unary.bruijn index b764e87..214bfb9 100644 --- a/std/Number/Unary.bruijn +++ b/std/Number/Unary.bruijn @@ -34,7 +34,7 @@ mod [[[[3 &k (3 [3 [[[0 (2 (5 1)) 1]]] [1] 1] [1]) ki]]]] ⧗ Unary → Unary ↠:test ((+3u) % (+5u)) ((+3u)) # returns true if the number is even (remainder mod 2 == 0) -even? [=?(0 % (+2u))] ⧗ Unary → Boolean +even? [0 not! true] ⧗ Unary → Boolean =²?‣ even? @@ -161,3 +161,7 @@ fac [[1 [[0 (1 [[2 1 (1 0)]])]] [1] i]] ⧗ Unary → Unary hyperfac [[1 [[(0 0) (1 [[2 1 (1 0)]])]] [1] i]] ⧗ Unary → Unary :test (hyperfac (+3u)) ((+108u)) + +# Wilson's theorem +# very inefficient but very golfable +prime? [=?(++(fac --0) % 0)] ⧗ Unary → Boolean |