MCPcopy Index your code
hub / github.com/numpy/numpy / _fix_int_lt_zero

Function _fix_int_lt_zero

numpy/lib/_scimath_impl.py:125–150  ·  view source on GitHub ↗

Convert `x` to double if it has real, negative components. Otherwise, output is just the array version of the input (via asarray). Parameters ---------- x : array_like Returns ------- array Examples -------- >>> import numpy as np >>> np.lib.scimath._f

(x)

Source from the content-addressed store, hash-verified

123
124
125def _fix_int_lt_zero(x):
126 """Convert `x` to double if it has real, negative components.
127
128 Otherwise, output is just the array version of the input (via asarray).
129
130 Parameters
131 ----------
132 x : array_like
133
134 Returns
135 -------
136 array
137
138 Examples
139 --------
140 >>> import numpy as np
141 >>> np.lib.scimath._fix_int_lt_zero([1,2])
142 array([1, 2])
143
144 >>> np.lib.scimath._fix_int_lt_zero([-1,2])
145 array([-1., 2.])
146 """
147 x = asarray(x)
148 if any(isreal(x) & (x < 0)):
149 x = x * 1.0
150 return x
151
152
153def _fix_real_abs_gt_1(x):

Callers 1

powerFunction · 0.85

Calls 3

anyFunction · 0.90
isrealFunction · 0.90
asarrayFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…