copysign
Return element-wise values ofx1 with the sign of x2. Inputs are broadcast together.
| Name | Type | Default | Description |
|---|---|---|---|
x1 | ArrayLike | — | Values whose magnitudes are used. |
x2 | ArrayLike | — | Values whose signs are copied. |
NDArray — Array with magnitudes from x1 and signs from x2.
signbit
Return element-wisetrue where the sign bit is set (i.e., the value is negative). This correctly detects -0.0.
| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | — | Input array. |
NDArray — Boolean array, true where the sign bit is set.
nextafter
Return the next representable floating-point value afterx1 towards x2, element-wise. Inputs are broadcast together.
| Name | Type | Default | Description |
|---|---|---|---|
x1 | ArrayLike | — | Starting values. |
x2 | ArrayLike | — | Direction values. |
NDArray — The next representable float after each x1[i] in the direction of x2[i].
spacing
Return the distance between each element and the nearest adjacent representable floating-point number. This is the ULP (unit in the last place) of each value.| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | — | Input array. |
NDArray — The spacing (ULP) for each element.
promote_types
Return the smallest dtype to which both input dtypes can be safely cast. This follows NumPy’s type promotion rules.| Name | Type | Default | Description |
|---|---|---|---|
dtype1 | DType | — | First dtype. |
dtype2 | DType | — | Second dtype. |
DType — The promoted dtype that can represent values from both input dtypes without loss.