Skip to content

Commit 183bb17

Browse files
committed
fix
1 parent cac5e76 commit 183bb17

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

big-num/omeganum.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ end
248248

249249
--- @param other t.Omega.Parsable
250250
function Big:compareTo(other)
251+
if not is_number(self) then self = Big:ensureBig(self) end
252+
if not is_number(other) then other = Big:ensureBig(other) end
253+
251254
if not Big.is(self) then
252255
if not Big.is(other) then
253256
return signcomp(self, other)
@@ -934,10 +937,10 @@ function Big:max_for_op(arrows)
934937
local arr = {}
935938
arr[1] = 10e9
936939
arr[arrows] = R.MAX_SAFE_INTEGER - 2
937-
for i = 2, math.min(arrows - 1, 1e6) do
940+
for i = 2, math.min(arrows - 1, 1e2) do
938941
arr[i] = 8
939942
end
940-
if arrows > 1e6 then
943+
if arrows > 1e2 then
941944
local limit = math.floor(math.log(arrows, 10))
942945
for i = 6, limit do
943946
arr[10^i] = 8

talisman/globals.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--- @meta
22

33
BigC = copy_table(require('big-num.constants'))
4+
local type = type
45

56
function is_big(x)
67
return Big and Big.is(x)

0 commit comments

Comments
 (0)