summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2018-05-29 12:18:18 -0700
committerGitHub <noreply@github.com>2018-05-29 12:18:18 -0700
commita5f7d644dd6bcaf425cc4c2d93d0f1df86cea1b0 (patch)
treee81bbf5f260e1028b1d9402cc76efdda1454be7c /numpy/add_newdocs.py
parente82617cb9b2043c40ebcf3a6808cbd61f7488bf5 (diff)
parent93e79a1a6708eebab6adc734f36e4e08c093aee0 (diff)
downloadnumpy-a5f7d644dd6bcaf425cc4c2d93d0f1df86cea1b0.tar.gz
Merge pull request #11186 from eric-wieser/format_float_OSprintf_g
TST: Add np.core._multiarray_tests.format_float_OSprintf_g
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index fc2130096..9372b3431 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -5607,6 +5607,37 @@ add_newdoc('numpy.core.multiarray', 'unpackbits',
""")
+add_newdoc('numpy.core._multiarray_tests', 'format_float_OSprintf_g',
+ """
+ format_float_OSprintf_g(val, precision)
+
+ Print a floating point scalar using the system's printf function,
+ equivalent to:
+
+ printf("%.*g", precision, val);
+
+ for half/float/double, or replacing 'g' by 'Lg' for longdouble. This
+ method is designed to help cross-validate the format_float_* methods.
+
+ Parameters
+ ----------
+ val : python float or numpy floating scalar
+ Value to format.
+
+ precision : non-negative integer, optional
+ Precision given to printf.
+
+ Returns
+ -------
+ rep : string
+ The string representation of the floating point value
+
+ See Also
+ --------
+ format_float_scientific
+ format_float_positional
+ """)
+
##############################################################################
#