in reply to [OT] Endianness and extended precision (80-bit) long doubles
I presume this for loop is within Perl code after a read of a binary file? You should consider pack() and unpack() to get the data into a Perl binary value (big endian). The right kind of pack() or unpack() is dependent upon the architecture (endianness).
It would be helpful to show some code and a short explanation of why you are accessing the individual bytes of what apparently is a multi-byte integer?
Update: too many bytes for an int.. I guess this is a float? It is quite common for binary values to written with big endian values to disk, etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [OT] Endianness and extended precision (80-bit) long doubles
by syphilis (Archbishop) on Aug 25, 2019 at 00:41 UTC | |
by Marshall (Canon) on Aug 25, 2019 at 01:38 UTC | |
by AnomalousMonk (Archbishop) on Aug 25, 2019 at 01:57 UTC | |
by syphilis (Archbishop) on Aug 26, 2019 at 06:20 UTC | |
by Marshall (Canon) on Aug 26, 2019 at 16:06 UTC | |
by AnomalousMonk (Archbishop) on Aug 26, 2019 at 21:34 UTC | |
|