diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-08-26 18:17:51 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-08-26 18:18:27 -0400 |
commit | aacf4ea26d4513c6378ba30b3ddef2101de36280 (patch) | |
tree | 40af62731a9d6e72377a62e6ba2bcdb6f90adcfe /pod/perlpacktut.pod | |
parent | cfa562529cf247facc919c1e0d7ae057a190de6c (diff) | |
download | perl-aacf4ea26d4513c6378ba30b3ddef2101de36280.tar.gz |
Sprinkle the fact that long doubles aren't standardized.
Diffstat (limited to 'pod/perlpacktut.pod')
-rw-r--r-- | pod/perlpacktut.pod | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pod/perlpacktut.pod b/pod/perlpacktut.pod index 608a592c27..a710f20f3f 100644 --- a/pod/perlpacktut.pod +++ b/pod/perlpacktut.pod @@ -496,14 +496,19 @@ For packing floating point numbers you have the choice between the pack codes C<f>, C<d>, C<F> and C<D>. C<f> and C<d> pack into (or unpack from) single-precision or double-precision representation as it is provided by your system. If your systems supports it, C<D> can be used to pack and -unpack extended-precision floating point values (C<long double>), which -can offer even more resolution than C<f> or C<d>. C<F> packs an C<NV>, -which is the floating point type used by Perl internally. (There -is no such thing as a network representation for reals, so if you want -to send your real numbers across computer boundaries, you'd better stick -to ASCII representation, unless you're absolutely sure what's on the other -end of the line. For the even more adventuresome, you can use the byte-order -modifiers from the previous section also on floating point codes.) +unpack (C<long double>) values, which can offer even more resolution +than C<f> or C<d>. B<Note that there are different long double formats.> + +C<F> packs an C<NV>, which is the floating point type used by Perl +internally. + +There is no such thing as a network representation for reals, so if +you want to send your real numbers across computer boundaries, you'd +better stick to text representation, possibly using the hexadecimal +float format (avoiding the decimal conversion loss), unless you're +absolutely sure what's on the other end of the line. For the even more +adventuresome, you can use the byte-order modifiers from the previous +section also on floating point codes. |