aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdzref_full3
-rw-r--r--impl.bqn14
-rwxr-xr-xtest/cmpref.bqn3
3 files changed, 18 insertions, 2 deletions
diff --git a/dzref_full b/dzref_full
index 3edbb93d..b6e9e517 100755
--- a/dzref_full
+++ b/dzref_full
@@ -35,8 +35,9 @@ X←Raw←{≤4}
"IsArray ← 0≠≡"
"_amend ← {𝕨{𝕩⋄𝕗}⌾(𝕗⊑⊢)𝕩}"
"Type ← ⟨⟩⥊0⊸⥊"
+ "Log ← ⋆⁼"
'!' Mod "{𝕩 ⋄ ≤1}⍟¬"
- ⟩∾Mod⟜⥊¨ "+-×÷⋆⌊=≤≢⥊⊑↕⌜⁼"
+ ⟩∾Mod⟜⥊¨ "+-×÷⋆⌊=≤≢⥊⊑↕⌜"
# checks if line is a builtin redefinition
diff --git a/impl.bqn b/impl.bqn
index 026c03f3..558ef06b 100644
--- a/impl.bqn
+++ b/impl.bqn
@@ -392,6 +392,20 @@ OccurrenceCount ← ⊐˜(⊢-⊏)⍋∘⍋
ProgressiveIndexOf ← {𝕨⊐○(≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩}
⊒ ← OccurrenceCount⊘ ProgressiveIndexOf
+inverse ← {(⊑(0⊏𝕩)⊐<) ⊑ ((1⊏𝕩)∾⟨!∘0⟩)˜} ⍉ (2∾˜2÷˜≠)⊸⥊ ⟨
+ +, +⊘(-˜)
+ -, -
+ ×, ⊢⊘(÷˜)
+ ÷, ÷
+ ⋆, Log
+ √, ⋆⟜2⊘(⋆˜)
+ ∧, ⊢⊘(÷˜)
+ ∨, ⊢⊘(-˜÷1-⊢)
+ <, {!IsArray𝕩⋄!0==𝕩⋄⊑𝕩}⊘(!∘0)
+ /, {!(⍋≡↕∘≠)𝕩⋄≠¨⊔𝕩}⊘(!∘0)
+⟩
+⁼ ← {Inverse 𝕗}
+
_repeat_←{
n←𝕨𝔾𝕩
l←u←0
diff --git a/test/cmpref.bqn b/test/cmpref.bqn
index 8186889a..86788f81 100755
--- a/test/cmpref.bqn
+++ b/test/cmpref.bqn
@@ -32,8 +32,9 @@ pre ← ⟨
"IsArray ← 0≠≡"
"_amend ← {𝕨{𝕩⋄𝕗}⌾(𝕗⊑⊢)𝕩}"
"Type ← ⟨⟩⥊0⊸⥊"
+ "Log ← ⋆⁼"
'!' Mod "{𝕩 ⋄ ≤1}⍟¬"
-⟩∾Mod⟜⥊¨ "+-×÷⋆⌊=≤≢⥊⊑↕⌜⁼"
+⟩∾Mod⟜⥊¨ "+-×÷⋆⌊=≤≢⥊⊑↕⌜"
# checks if line is a builtin redefinition