Skip to content

Commit 300096d

Browse files
authored
MAINT: updated instructions to get MachAr byte pattern (numpy#26415)
* MAINT: updated instructions to get MachAr byte pattern
1 parent 766ee27 commit 300096d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

numpy/_core/getlimits.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ def _float_to_str(self, value):
146146
title = _title_fmt.format('half'))}
147147

148148
# Key to identify the floating point type. Key is result of
149-
# ftype('-0.1').newbyteorder('<').tobytes()
150149
#
151-
# 20230201 - use (ftype(-1.0) / ftype(10.0)).newbyteorder('<').tobytes()
152-
# instead because stold may have deficiencies on some platforms.
150+
# ftype = np.longdouble # or float64, float32, etc.
151+
# v = (ftype(-1.0) / ftype(10.0))
152+
# v.view(v.dtype.newbyteorder('<')).tobytes()
153+
#
154+
# Uses division to work around deficiencies in strtold on some platforms.
153155
# See:
154156
# https://perl5.git.perl.org/perl.git/blob/3118d7d684b56cbeb702af874f4326683c45f045:/Configure
155157

0 commit comments

Comments
 (0)