|
2 | 2 | -- ULTIMATE INT -- |
3 | 3 | ---------------------------------------------------- |
4 | 4 | -- MODULE VERSION: 186 |
5 | | --- BUILD VERSION: 186.6 (26/11/2025) dd:mm:yyyy |
| 5 | +-- BUILD VERSION: 186.6 (28/11/2025) dd:mm:yyyy |
6 | 6 | -- USER FEATURE: 26/11/2025 |
7 | 7 | -- DEV FEATURE: 26/11/2025 |
8 | 8 | -- AUTHOR: SupTan85 |
@@ -274,16 +274,15 @@ master.equation = { |
274 | 274 | return false |
275 | 275 | end, |
276 | 276 | less = function(x, y) -- chunk size should be same |
| 277 | + -- BUILD 186.6 |
277 | 278 | assert((x._size or 1) == (y._size or 1), ("[EQUATION] INVALID_SIZE_PERCHUNK (%s, %s)"):format(x._size or 1, y._size or 1)) |
278 | 279 | if #x < #y then |
279 | 280 | return true |
280 | | - elseif #x == #y or x[#x] == 0 or y[#y] == 0 then |
281 | | - for i = #x, x._dlen or 1, -1 do |
| 281 | + elseif #x == #y then |
| 282 | + for i = #x, min((x._dlen or 1), (y._dlen or 1)) or 1, -1 do |
282 | 283 | local vx, vy = x[i] or 0, y[i] or 0 |
283 | | - if vx < vy then |
284 | | - return true |
285 | | - elseif vx > vy then |
286 | | - return false |
| 284 | + if vx ~= vy then |
| 285 | + return vx < vy |
287 | 286 | end |
288 | 287 | end |
289 | 288 | end |
@@ -590,13 +589,13 @@ master.calculate = { |
590 | 589 | local p = b == "1" and "1" or tostring("1" / b) |
591 | 590 | if p:find("e") then |
592 | 591 | local L, R = p:match("^[-+]?(%d-%.?%d+)e"), p:match("e[-+]?(%d+)$") |
593 | | - L, lastpoint = L:sub(1, -2), L:sub(-2, -2) |
594 | | - local S = #L:match("^(%d+)%.") |
| 592 | + L, lastpoint = #L > 1 and L:sub(1, -2) or L, #L > 1 and L:sub(-2, -2) or L |
| 593 | + local S = #L:match("^(%d+)%.?") |
595 | 594 | if R > master._config.MAXIMUM_LUA_INTEGER then |
596 | 595 | return {L:gsub("%.", ""), self.sub(masterC(R, s), masterC(S, s))} |
597 | 596 | end |
598 | | - return "0."..("0"):rep(tonumber(R) - S)..L:gsub("%.", ""):sub(1, -4) |
599 | | - elseif p ~= "0.0" then |
| 597 | + return "0."..("0"):rep(tonumber(R) - S)..(#L > 1 and L:gsub("%.", ""):sub(1, -2) or L) |
| 598 | + elseif p ~= "0.0" and p ~= "0" then |
600 | 599 | lastpoint = p:sub(-1) |
601 | 600 | if #p > 13 then |
602 | 601 | p = p:sub(1, -2) |
|
0 commit comments