Skip to content

Commit e76dd5c

Browse files
author
Ben Baumgold
committed
#70 more clear
1 parent 945c232 commit e76dd5c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/TableView.jl

+11-2
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,17 @@ function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength,
258258
onimport(w, handler)
259259
end
260260

261-
_is_javascript_safe(x::Integer) = -(Int64(2)^53-1) < x < Int64(2)^53-1
262-
_is_javascript_safe(x::AbstractFloat) = -(Float64(2)^53-1) < x < Float64(2)^53-1
261+
function _is_javascript_safe(x::Integer)
262+
min_safe_int = -(Int64(2)^53-1)
263+
max_safe_int = Int64(2)^53-1
264+
min_safe_int < x < max_safe_int
265+
end
266+
267+
function _is_javascript_safe(x::AbstractFloat)
268+
min_safe_float = -(Float64(2)^53-1)
269+
max_safe_float = Float64(2)^53-1
270+
min_safe_float < x < max_safe_float
271+
end
263272

264273
# directly write JSON instead of allocating temporary dicts etc
265274
function table2json(schema, rows, types; requested = nothing)

0 commit comments

Comments
 (0)