in reply to Re: [OT] Endianness and extended precision (80-bit) long doubles
in thread [OT] Endianness and extended precision (80-bit) long doubles
If I ran the identical one-liner on a 64-bit *big-endian* machine,running a perl whose NV is the extended precision (80-bit) long double, where would that substring of 12 consecutive zeroes appear ? Would it still appear at the end of the string (as was the case on my little-endian machine), or would it appear at the beginning ?$ perl -le 'print unpack "h*", pack "D", sqrt 2;' 4846ed9f333f405bfff3000000000000
but I don't recall having ever established the correctness of that code for the big-endian case..... n = bits == 64 ? 10 : 16; #ifdef MPFR_HAVE_BENDIAN /* Big Endian architecture */ for (i = 0; i < n; i++) { #else for (i = n - 1; i >= 0; i--) { #endif // code that does something with byte i
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: [OT] Endianness and extended precision (80-bit) long doubles
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 | |
by choroba (Cardinal) on Aug 28, 2019 at 16:00 UTC |