|
51 | 51 | "remainder",
|
52 | 52 | "round",
|
53 | 53 | "sign",
|
| 54 | + "signbit", |
54 | 55 | "sin",
|
55 | 56 | "sinh",
|
56 | 57 | "square",
|
@@ -2215,6 +2216,40 @@ def sign(x: array, /) -> array:
|
2215 | 2216 | """
|
2216 | 2217 |
|
2217 | 2218 |
|
| 2219 | +def signbit(x: array, /) -> array: |
| 2220 | + r""" |
| 2221 | + Determines whether the sign bit is set for each element ``x_i`` of the input array ``x``. |
| 2222 | +
|
| 2223 | + The sign bit of a real-valued floating-point number ``x_i`` is set whenever ``x_i`` is either ``-0``, less than zero, or a signed ``NaN`` (i.e., a ``NaN`` value whose sign bit is ``1``). |
| 2224 | +
|
| 2225 | + Parameters |
| 2226 | + ---------- |
| 2227 | + x: array |
| 2228 | + input array. Should have a real-valued floating-point data type. |
| 2229 | +
|
| 2230 | + Returns |
| 2231 | + ------- |
| 2232 | + out: array |
| 2233 | + an array containing the evaluated result for each element in ``x``. The returned array must have a data type of ``bool``. |
| 2234 | +
|
| 2235 | + Notes |
| 2236 | + ----- |
| 2237 | +
|
| 2238 | + **Special cases** |
| 2239 | +
|
| 2240 | + For real-valued floating-point operands, |
| 2241 | +
|
| 2242 | + - If ``x_i`` is ``+0``, the result is ``False``. |
| 2243 | + - If ``x_i`` is ``-0``, the result is ``True``. |
| 2244 | + - If ``x_i`` is ``+infinity``, the result is ``False``. |
| 2245 | + - If ``x_i`` is ``-infinity``, the result is ``True``. |
| 2246 | + - If ``x_i`` is a positive (i.e., greater than ``0``) finite number, the result is ``False``. |
| 2247 | + - If ``x_i`` is a negative (i.e., less than ``0``) finite number, the result is ``True``. |
| 2248 | + - If ``x_i`` is ``NaN`` and the sign bit of ``x_i`` is ``0``, the result is ``False``. |
| 2249 | + - If ``x_i`` is ``NaN`` and the sign bit of ``x_i`` is ``1``, the result is ``True``. |
| 2250 | + """ |
| 2251 | + |
| 2252 | + |
2218 | 2253 | def sin(x: array, /) -> array:
|
2219 | 2254 | r"""
|
2220 | 2255 | Calculates an implementation-dependent approximation to the sine for each element ``x_i`` of the input array ``x``.
|
|
0 commit comments