mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
Bluon: Write out-of-bounds ints as floats
This commit is contained in:
parent
cc0a56dd7a
commit
898db2c278
@ -1,6 +1,6 @@
|
|||||||
-- Localize globals
|
-- Localize globals
|
||||||
local assert, error, ipairs, math_floor, math_huge, modlib, next, pairs, setmetatable, string, table_insert, type, unpack
|
local assert, error, ipairs, math_floor, math_abs, math_huge, modlib, next, pairs, setmetatable, string, table_insert, type, unpack
|
||||||
= assert, error, ipairs, math.floor, math.huge, modlib, next, pairs, setmetatable, string, table.insert, type, unpack
|
= assert, error, ipairs, math.floor, math.abs, math.huge, modlib, next, pairs, setmetatable, string, table.insert, type, unpack
|
||||||
|
|
||||||
-- Set environment
|
-- Set environment
|
||||||
local _ENV = {}
|
local _ENV = {}
|
||||||
@ -203,7 +203,7 @@ function write(self, value, stream)
|
|||||||
stream:write(constant_nan)
|
stream:write(constant_nan)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if value % 1 == 0 then
|
if value % 1 == 0 and math_abs(value) < 2^64 then
|
||||||
uint_with_type(value > 0 and type_ranges.number_constant or type_ranges.number_negative, value > 0 and value or -value)
|
uint_with_type(value > 0 and type_ranges.number_constant or type_ranges.number_negative, value > 0 and value or -value)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user