On Wed, Sep 23, 2009 at 15:53, Bob McConnell <r...@cbord.com> wrote: snip > OK, that I can understand. However, I don't see where that was expressed > or implied in the original query. Are you assuming that every current > architecture and Perl implementation uses that format to store double > precision numbers? Is that a safe assumption? > > Bob McConnell snip
No, it is not safe to assume that the value you get from pack will work on another platform. The pack function claims that "d" creates a native-floating point number as a string of bytes. This means you are dependent on the native implementations of floating point numbers being the same between systems. However, a quick sample of OS X 10.5 (x86), a variety of Linuxes (x86), Win32 (x86), and FreeBsd (x86) shows that it works across a wide swath of what one generally works with. The Power PC machine machine I have access to (running OS X) works if you reverse the bytes. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/