From 300096d384046eee479b0c7a70f79e308da52bff Mon Sep 17 00:00:00 2001 From: Andrew Nelson Date: Sat, 11 May 2024 09:41:32 +1000 Subject: [PATCH] MAINT: updated instructions to get MachAr byte pattern (#26415) * MAINT: updated instructions to get MachAr byte pattern --- numpy/_core/getlimits.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/numpy/_core/getlimits.py b/numpy/_core/getlimits.py index c582a79e5fb2..b01e47fade43 100644 --- a/numpy/_core/getlimits.py +++ b/numpy/_core/getlimits.py @@ -146,10 +146,12 @@ def _float_to_str(self, value): title = _title_fmt.format('half'))} # Key to identify the floating point type. Key is result of -# ftype('-0.1').newbyteorder('<').tobytes() # -# 20230201 - use (ftype(-1.0) / ftype(10.0)).newbyteorder('<').tobytes() -# instead because stold may have deficiencies on some platforms. +# ftype = np.longdouble # or float64, float32, etc. +# v = (ftype(-1.0) / ftype(10.0)) +# v.view(v.dtype.newbyteorder('<')).tobytes() +# +# Uses division to work around deficiencies in strtold on some platforms. # See: # https://perl5.git.perl.org/perl.git/blob/3118d7d684b56cbeb702af874f4326683c45f045:/Configure