| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -536,31 +536,7 @@ def dec(*args, **kwargs): | |||
| 536 | 536 | def _have_ieee_doubles(): | |
| 537 | 537 | if sys.implementation.name == 'cpython': | |
| 538 | 538 | return True | |
| 539 | - import math | ||
| 540 | - import struct | ||
| 541 | - # Check parameters for encoding of floats; a quick exit | ||
| 542 | - # if they aren't same as for IEC 60559 doubles. Check | ||
| 543 | - # also that subnormals are present. | ||
| 544 | - if (struct.calcsize('d') != 8 | ||
| 545 | - or sys.float_info.radix != 2 | ||
| 546 | - or sys.float_info.mant_dig != 53 | ||
| 547 | - or sys.float_info.dig != 15 | ||
| 548 | - or sys.float_info.min_exp != -1021 | ||
| 549 | - or sys.float_info.min_10_exp != -307 | ||
| 550 | - or sys.float_info.max_exp != 1024 | ||
| 551 | - or sys.float_info.max_10_exp != 308 | ||
| 552 | - or not math.issubnormal(math.nextafter(0, 1))): | ||
| 553 | - return False | ||
| 554 | - # We attempt to determine if this machine is using IEC | ||
| 555 | - # floating-point formats by peering at the bits of some | ||
| 556 | - # carefully chosen value. Assume that integer and | ||
| 557 | - # floating-point types have same endianness. | ||
| 558 | - d = 9006104071832581.0 | ||
| 559 | - d_be_bytes = b"\x43\x3f\xff\x01\x02\x03\x04\x05" | ||
| 560 | - d_packed = struct.pack('d', d) | ||
| 561 | - if sys.byteorder == 'little': | ||
| 562 | - return d_packed == bytes(reversed(d_be_bytes)) | ||
| 563 | - return d_packed == d_be_bytes | ||
| 539 | + return False | ||
| 564 | 540 | ||
| 565 | 541 | HAVE_IEEE_754 = _have_ieee_doubles() | |
| 566 | 542 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments