diff --git a/spec/API_specification/array_object.md b/spec/API_specification/array_object.md index 5bae82980..3caa7b1be 100644 --- a/spec/API_specification/array_object.md +++ b/spec/API_specification/array_object.md @@ -274,7 +274,7 @@ Transpose of the array. Calculates the absolute value for each element `x_i` of an array instance `x` (i.e., the element-wise result has the same magnitude as the respective element in `x` but has positive sign). #### Special Cases - + For floating-point operands, - If `x_i` is `NaN`, the result is `NaN`. @@ -377,6 +377,24 @@ Evaluates `x1_i & x2_i` for each element `x1_i` of an array instance `x1` with t Element-wise results must equal the results returned by the equivalent element-wise function [`bitwise_and(x1, x2)`](elementwise_functions.md#logical_andx1-x2-). ``` +(method-__bool__)= +### \_\_bool\_\_(x, /) + +Converts a zero-dimensional boolean array to a Python `bool` object. + +#### Parameters + +- **x**: _<array>_ + + - zero-dimensional array instance. Must have a boolean data type. + +#### Returns + +- **out**: _<bool>_ + + - a Python `bool` object representing the single element of the array `x`. + + (method-__dlpack__)= ### \_\_dlpack\_\_(/, *, stream=None) @@ -419,6 +437,7 @@ Exports the array as a DLPack capsule, for consumption by {ref}`function-from_dl - A DLPack capsule for the array. See {ref}`data-interchange` for details. + (method-__dlpack_device__)= ### \_\_dlpack\_device\_\_() @@ -467,6 +486,23 @@ Computes the truth value of `x1_i == x2_i` for each element `x1_i` of an array i Element-wise results must equal the results returned by the equivalent element-wise function [`equal(x1, x2)`](elementwise_functions.md#equalx1-x2-). ``` +(method-__float__)= +### \_\_float\_\_(x, /) + +Converts a zero-dimensional floating-point array to a Python `float` object. + +#### Parameters + +- **x**: _<array>_ + + - zero-dimensional array instance. Must have a floating-point data type. + +#### Returns + +- **out**: _<float>_ + + - a Python `float` object representing the single element of the array `x`. + (method-__floordiv__)= ### \_\_floordiv\_\_(x1, x2, /) @@ -550,6 +586,23 @@ Computes the truth value of `x1_i > x2_i` for each element `x1_i` of an array in Element-wise results must equal the results returned by the equivalent element-wise function [`greater(x1, x2)`](elementwise_functions.md#greaterx1-x2-). ``` +(method-__int__)= +### \_\_int\_\_(x, /) + +Converts a zero-dimensional integer array to a Python `int` object. + +#### Parameters + +- **x**: _<array>_ + + - zero-dimensional array instance. Must have an integer data type. + +#### Returns + +- **out**: _<int>_ + + - a Python `int` object representing the single element of the array `x`. + (method-__invert__)= ### \_\_invert\_\_(x, /)