@@ -240,20 +240,20 @@ function lenient_bignum(x)
240240 if ante < 1 then return to_big (100 ) end
241241 if ante <= 8 then
242242 local amount = amounts [ante ]
243- if (amount : lt ( R .E_MAX_SAFE_INTEGER ) ) then
244- local exponent = to_big (10 )^ (math.floor (amount : log10 ( ) - to_big (1 ))): to_number ( )
245- amount = math.floor (amount / exponent ): to_number ( ) * exponent
243+ if to_big (amount ) < to_big ( R and R .E_MAX_SAFE_INTEGER or 9e15 ) then
244+ local exponent = to_big (10 )^ to_number (math.floor (math.log ( amount , 10 ) - to_big (1 )))
245+ amount = to_number ( math.floor (amount / exponent )) * exponent
246246 end
247- amount :normalize ()
247+ if type ( amount ) == " table " then amount :normalize () end
248248 return amount
249249 end
250250 local a , b , c , d = amounts [8 ], amounts [8 ]/ amounts [7 ], ante - 8 , 1 + 0.2 * (ante - 8 )
251251 local amount = math.floor (a * (b + (b * k * c )^ d )^ c )
252- if (amount : lt ( R .E_MAX_SAFE_INTEGER ) ) then
253- local exponent = to_big (10 )^ (math.floor (amount : log10 ( ) - to_big (1 ))): to_number ( )
254- amount = math.floor (amount / exponent ): to_number ( ) * exponent
252+ if to_big (amount ) < to_big ( R and R .E_MAX_SAFE_INTEGER or 9e15 ) then
253+ local exponent = to_big (10 )^ to_number (math.floor (math.log ( amount , 10 ) - to_big (1 )))
254+ amount = to_number ( math.floor (amount / exponent )) * exponent
255255 end
256- amount :normalize ()
256+ if type ( amount ) == " table " then amount :normalize () end
257257 return amount
258258 end
259259 end
@@ -272,11 +272,11 @@ function lenient_bignum(x)
272272 if ante <= 8 then return amounts [ante ] end
273273 local a , b , c , d = amounts [8 ],1.6 ,ante - 8 , 1 + 0.2 * (ante - 8 )
274274 local amount = a * (b + (k * c )^ d )^ c
275- if (amount : lt ( R .E_MAX_SAFE_INTEGER ) ) then
276- local exponent = to_big (10 )^ (math.floor (amount : log10 ( ) - to_big (1 ))): to_number ( )
277- amount = math.floor (amount / exponent ): to_number ( ) * exponent
275+ if to_big (amount ) < to_big ( R and R .E_MAX_SAFE_INTEGER or 9e15 ) then
276+ local exponent = to_big (10 )^ to_number (math.floor (math.log ( amount , 10 ) - to_big (1 )))
277+ amount = to_number ( math.floor (amount / exponent )) * exponent
278278 end
279- amount :normalize ()
279+ if type ( amount ) == " table " then amount :normalize () end
280280 return amount
281281 elseif G .GAME .modifiers .scaling == 2 then
282282 local amounts = {
@@ -287,11 +287,11 @@ function lenient_bignum(x)
287287 if ante <= 8 then return amounts [ante ] end
288288 local a , b , c , d = amounts [8 ],1.6 ,ante - 8 , 1 + 0.2 * (ante - 8 )
289289 local amount = a * (b + (k * c )^ d )^ c
290- if (amount : lt ( R .E_MAX_SAFE_INTEGER ) ) then
291- local exponent = to_big (10 )^ (math.floor (amount : log10 ( ) - to_big (1 ))): to_number ( )
292- amount = math.floor (amount / exponent ): to_number ( ) * exponent
290+ if to_big (amount ) < to_big ( R and R .E_MAX_SAFE_INTEGER or 9e15 ) then
291+ local exponent = to_big (10 )^ to_number (math.floor (math.log ( amount , 10 ) - to_big (1 )))
292+ amount = to_number ( math.floor (amount / exponent )) * exponent
293293 end
294- amount :normalize ()
294+ if type ( amount ) == " table " then amount :normalize () end
295295 return amount
296296 elseif G .GAME .modifiers .scaling == 3 then
297297 local amounts = {
@@ -302,11 +302,11 @@ function lenient_bignum(x)
302302 if ante <= 8 then return amounts [ante ] end
303303 local a , b , c , d = amounts [8 ],1.6 ,ante - 8 , 1 + 0.2 * (ante - 8 )
304304 local amount = a * (b + (k * c )^ d )^ c
305- if (amount : lt ( R .E_MAX_SAFE_INTEGER ) ) then
306- local exponent = to_big (10 )^ (math.floor (amount : log10 ( ) - to_big (1 ))): to_number ( )
307- amount = math.floor (amount / exponent ): to_number ( ) * exponent
305+ if to_big (amount ) < to_big ( R and R .E_MAX_SAFE_INTEGER or 9e15 ) then
306+ local exponent = to_big (10 )^ to_number (math.floor (math.log ( amount , 10 ) - to_big (1 )))
307+ amount = to_number ( math.floor (amount / exponent )) * exponent
308308 end
309- amount :normalize ()
309+ if type ( amount ) == " table " then amount :normalize () end
310310 return amount
311311 end
312312 end
0 commit comments