summaryrefslogtreecommitdiff
path: root/silx/utils/number.py
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2019-12-23 13:45:09 +0100
committerPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2019-12-23 13:45:09 +0100
commit5d647cf9a6159afd2933da594b9c79ad93d3cd9b (patch)
tree2571025a602f68fc8933b01104dc712d41f84034 /silx/utils/number.py
parent654a6ac93513c3cc1ef97cacd782ff674c6f4559 (diff)
New upstream version 0.12.0~b0+dfsg
Diffstat (limited to 'silx/utils/number.py')
-rwxr-xr-x[-rw-r--r--]silx/utils/number.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/silx/utils/number.py b/silx/utils/number.py
index 92e98fe..f852a39 100644..100755
--- a/silx/utils/number.py
+++ b/silx/utils/number.py
@@ -68,8 +68,8 @@ def is_longdouble_64bits():
def min_numerical_convertible_type(string, check_accuracy=True):
"""
- Parse the string and return the smallest numerical type to use for a safe
- conversion.
+ Parse the string and try to return the smallest numerical type to use for
+ a safe conversion. It has some known issues: precission loss.
:param str string: Representation of a float/integer with text
:param bool check_accuracy: If true, a warning is pushed on the logger
@@ -104,7 +104,7 @@ def min_numerical_convertible_type(string, check_accuracy=True):
exponent = "0"
nb_precision_digits = int(exponent) - len(decimal) - 1
- precision = _biggest_float(10) ** nb_precision_digits * 2.5
+ precision = _biggest_float(10) ** nb_precision_digits * 1.2
previous_type = _biggest_float
for numpy_type in _float_types:
if numpy_type == _biggest_float: