Comments (1)
I found what the issue was, it wasn't a precision error at all. You were deciding whether a lua_Number n represented a floating point value (float/double) instead of an integer through the comparison floor(n) != n. This fails when n is +-inf, since then floor(n) == n. When n is NaN, this also fails, since even tough floor(n) will return n, NaN fails to compare equal to any number, even itself. Your method also has the issue of not checking whether the floating point value could actually be represented by an int64_t, if it is integral in value.
I'm making a fork of the project, intending to send a pull request later.
from lua-cmsgpack.
Related Issues (20)
- Wrong size passed into realloc on delete of buf HOT 1
- Nil as table index HOT 1
- unpack method in release 0.3.0 returning an error with redis Redis 3.0.2 HOT 4
- Fix compilation warnings
- Improve the LuaRock HOT 1
- Extension type support HOT 1
- List project on msgpack.org
- @user_script:6: Bad data format in input. HOT 1
- Compile error with MSVC2010
- compile error with MSVC2010 - isinf()
- linker issues: undefined symbol: lua_tointeger HOT 1
- Lua stack corruption bug
- fix incompatibilities with lua 5.2 ? HOT 1
- compatibility with other language using msgpack?
- table_is_an_array BUG
- Version installed from luarocks vulnerable to CVE-2018-11218 HOT 3
- Question about the separator of cmsgpack data
- mp_buf_append and sanitizing realloc
- cmsgpack.pack(t) got empty HOT 1
- git:// protocol in rockspec is not supported by github anymore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-cmsgpack.