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)
| 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): |
nothing calls this directly
no test coverage detected