Comments (3)
Float64 is another name for a double, so I would use it if you need full precision. Its not interchangable with an Int64 necessarily, but with any number below 2^53 it is.
from bitbuffer.
This was a deliberate choice. Numbers in Lua are doubles, which have 53 significant bits. Without some sort of bigint implementation (which is well outside of scope), it's impossible to actually have 64 bit integers. I'd rather not lie to people about the precision of integers because it seems like a footgun waiting to happen.
from bitbuffer.
Thanks for your answer. Do you reckon using Float64 is a good substitute? (I'm not too familiar with binary data types so I'm not sure if that's the same as the Lua number type 😅 )
from bitbuffer.
Related Issues (20)
- Switch to using hex for all constants
- Add functions for exporting in chunks HOT 1
- Remove adler32
- Reimplement writeUnsigned to finish off current byte when buffer isn't aligned HOT 1
- Change writeSigned + writeFloat to include the sign bit in the writeUnsigned call HOT 1
- Add function for setting pointer by byte instead of bit
- Add a function for setting the pointer relative to the end of the stream
- Don't throw in readSetLengthString when the length is 0
- Come up with solution for reading/writing little endian numbers HOT 1
- Make sure all the write functions actually return `nil`
- Read base64 string buffer HOT 2
- dumpBase64 using incorrect table.create amount HOT 1
- option to use little-endian instead of big-endian? HOT 3
- Remove bit-level packing
- Add several common datatypes to module as shorthands HOT 2
- Add documentation for the module
- Swap bitbuffer functions to be compatible with colon syntax HOT 1
- Assertion messages are inconsisent
- Throw when handling greater than 52-bit integers HOT 2
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 bitbuffer.