Comments (6)
Fixed two problems with float packing unpacking. One was with native endian, double precision (was using 'F', now uses 'D') and that packing in single precision made all subsequent packing single precision (even if double precision was requested).
If this hasn't fixed your issue, please let me know!
Thanks
from packable.
Hmm. Still seems to not quite be working for me. I have to add :endian => :little
to the options, though unpack('D')
works fine for me.
from packable.
Mmmm, here's what I have on my end:
$ irb
1.9.3p194 :001 > require 'packable'
=> true
1.9.3p194 :002 > 1.1.pack(:double)
=> "?\xF1\x99\x99\x99\x99\x99\x9A"
1.9.3p194 :003 > Packable::VERSION
=> "1.3.5"
1.9.3p194 :005 > `ruby -v`
=> "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]\n"
What's on your end?
from packable.
I get the same thing, but 1.1.pack(:double)
is not doing :endian => :native
, as far as I can tell.
1.1.pack(:double)
=> "?\xF1\x99\x99\x99\x99\x99\x9A"
1.1.pack('E')
=> "\x9A\x99\x99\x99\x99\x99\xF1?"
1.1.pack('D')
=> "\x9A\x99\x99\x99\x99\x99\xF1?"
1.1.pack(:precision => :double, :endian => :native)
=> "\x9A\x99\x99\x99\x99\x99\xF1?"
from packable.
Indeed, the default is :endian => :big
, not sure why I chose that at the time. I'll close this issue, then, since you can adjust the settings or specify the endianness you want, things work.
Or let me know what you'd like to be done!
from packable.
It just seems like it makes more sense to use whatever the native setting is.
from packable.
Related Issues (8)
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 packable.