From c7323ea7b7f3a0e4698c66eda8ec9680bc8819a4 Mon Sep 17 00:00:00 2001 From: cg223 Date: Mon, 8 Dec 2025 21:05:00 -0500 Subject: [PATCH] allow Big operations to be performed on numbers --- talisman.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/talisman.lua b/talisman.lua index bfa2fee..3667e87 100644 --- a/talisman.lua +++ b/talisman.lua @@ -186,6 +186,18 @@ if Talisman.config_file.break_infinity then return obj end + debug.setmetatable(0, { + __index = function(self, index) + if index == "array" then + return {self} + elseif index == "sign" then + return self >= 0 and 1 or -1 + else + return assert(Big[index], "Attempt to index a number value") + end + end, + }) + local override_non_bigs = true local nf = number_format