Data::IEEE754(3pm)

πŸ“¦
version 0.02 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Data::IEEE754 ✨

okay bestie, welcome to Data::IEEE754 β€” a little Perl module from the User Contributed Perl Documentation corner of the world that packs and unpacks big-endian IEEE754 floats and doubles. that's the whole vibe. πŸŽ€


🌸 VERSION 🌸

version 0.02 β€” she's a baby, she's tiny, she's doing her best πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

use Data::IEEE754 qw( pack_double_be unpack_double_be );

my $packed = pack_double_be(3.14);
my $double = unpack_double_be($packed);

see how easy that is?? in, out, done. no thoughts, just bytes. ✨


πŸ’… DESCRIPTION πŸ’…

so basically this module gives u some simple convenience functions for packing and unpacking IEEE 754 floats and doubles. that's it. that's the job. 🫢

real talk though β€” if you can require Perl 5.10 or greater, then this module is pointless. like, genuinely. just use the d> and f> pack formats instead! no cap. i'm telling u as a friend. πŸ’€

right now this module only implements big-endian order. patches to add little-endian order subroutines are welcome β€” bestie, if u got the code, send it in, we'd be obsessed 🧚


πŸŽ€ EXPORTS πŸŽ€

this module optionally exports the following four functions:

  • pack_float_be($number)
  • pack_double_be($number)
  • unpack_float_be($binary)
  • unpack_double_be($binary)

four icons. four legends. pick which ones u want in ur qw() and go off πŸ‘‘


🌈 CREDITS 🌈

ngl, the code in this module is more or less copied and pasted from Data::MessagePack's Data::MessagePack::PP module. that module was written by Makamaka Hannyaharamitu. then the code was tweaked by Dave Rolsky, so blame him for the bugs πŸ’€βœ¨ (affectionate)


πŸ’œ SUPPORT πŸ’œ

got a bug? please submit it to the CPAN RT system at http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-IEEE754 or via email at bug-data-ieee754@rt.cpan.org. πŸ›

bugs may also be submitted through https://github.com/maxmind/Data-IEEE754/issues.


πŸ‘‘ AUTHOR πŸ‘‘

Dave Rolsky <autarch@urth.org>


⭐ CONTRIBUTORS ⭐

  • Dave Rolsky <drolsky@maxmind.com>
  • Greg Oschwald <goschwald@maxmind.com>

this software is Copyright (c) 2017 by MaxMind, Inc.

this is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

and that's the whole page, bestie πŸ¦‹ this was Data::IEEE754, page 3 of the perl manual, served up fresh from perl v5.36.0 on 2022-12-02. go forth and pack ur doubles. periodt πŸ’…πŸŒΈ