MCPcopy Create free account
hub / github.com/numpy/numpy / smallest_subnormal

Method smallest_subnormal

numpy/core/getlimits.py:63–84  ·  view source on GitHub ↗

Return the value for the smallest subnormal. Returns ------- smallest_subnormal : float value for the smallest subnormal. Warns ----- UserWarning If the calculated value for the smallest subnormal is zero.

(self)

Source from the content-addressed store, hash-verified

61
62 @property
63 def smallest_subnormal(self):
64 """Return the value for the smallest subnormal.
65
66 Returns
67 -------
68 smallest_subnormal : float
69 value for the smallest subnormal.
70
71 Warns
72 -----
73 UserWarning
74 If the calculated value for the smallest subnormal is zero.
75 """
76 # Check that the calculated value is not zero, in case it raises a
77 # warning.
78 value = self._smallest_subnormal
79 if self.ftype(0) == value:
80 warnings.warn(
81 'The value of the smallest subnormal for {} type '
82 'is zero.'.format(self.ftype), UserWarning, stacklevel=2)
83
84 return self._float_to_float(value)
85
86 @property
87 def _str_smallest_subnormal(self):

Callers

nothing calls this directly

Calls 2

_float_to_floatMethod · 0.95
warnMethod · 0.80

Tested by

no test coverage detected