Lua 5.2 and lower only has 64-bit doubles, so we need to * detect if the double may be representable as an int * for Lua < 5.3 */
| 365 | * detect if the double may be representable as an int |
| 366 | * for Lua < 5.3 */ |
| 367 | void mp_encode_lua_number(lua_State *L, mp_buf *buf) { |
| 368 | lua_Number n = lua_tonumber(L,-1); |
| 369 | |
| 370 | if (IS_INT64_EQUIVALENT(n)) { |
| 371 | mp_encode_lua_integer(L, buf); |
| 372 | } else { |
| 373 | mp_encode_double(L,buf,(double)n); |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | void mp_encode_lua_type(lua_State *L, mp_buf *buf, int level); |
| 378 |
no test coverage detected