|
838 | 838 |
|
839 | 839 | Args:
|
840 | 840 | x1 (usm_ndarray):
|
841 |
| - First input array, expected to have numeric data type. |
| 841 | + First input array, expected to have a real-valued data type. |
842 | 842 | x2 (usm_ndarray):
|
843 |
| - Second input array, also expected to have numeric data type. |
| 843 | + Second input array, also expected to have real-valued data type. |
844 | 844 | out ({None, usm_ndarray}, optional):
|
845 | 845 | Output array to populate.
|
846 | 846 | Array have the correct shape and the expected data type.
|
|
1149 | 1149 | )
|
1150 | 1150 |
|
1151 | 1151 | # B22: ==== REMAINDER (x1, x2)
|
1152 |
| -# FIXME: implement B22 |
| 1152 | +_remainder_docstring_ = """ |
| 1153 | +remainder(x1, x2, out=None, order='K') |
| 1154 | +
|
| 1155 | +Calculates the remainder of division for each element `x1_i` of the input array |
| 1156 | +`x1` with the respective element `x2_i` of the input array `x2`. |
| 1157 | +
|
| 1158 | +This function is equivalent to the Python modulus operator. |
| 1159 | +
|
| 1160 | +Args: |
| 1161 | + x1 (usm_ndarray): |
| 1162 | + First input array, expected to have a real-valued data type. |
| 1163 | + x2 (usm_ndarray): |
| 1164 | + Second input array, also expected to have a real-valued data type. |
| 1165 | +Returns: |
| 1166 | + usm_ndarray: |
| 1167 | + an array containing the element-wise remainders. The data type of |
| 1168 | + the returned array is determined by the Type Promotion Rules. |
| 1169 | +""" |
| 1170 | +remainder = BinaryElementwiseFunc( |
| 1171 | + "remainder", ti._remainder_result_type, ti._remainder, _remainder_docstring_ |
| 1172 | +) |
1153 | 1173 |
|
1154 | 1174 | # U28: ==== ROUND (x)
|
1155 | 1175 | _round_docstring = """
|
|
1178 | 1198 | )
|
1179 | 1199 |
|
1180 | 1200 | # U29: ==== SIGN (x)
|
1181 |
| -# FIXME: implement U29 |
| 1201 | +_sign_docstring = """ |
| 1202 | +sign(x, out=None, order='K') |
| 1203 | +
|
| 1204 | +Computes an indication of the sign of each element `x_i` of input array `x` |
| 1205 | +using the signum function. |
| 1206 | +
|
| 1207 | +The signum function returns `-1` if `x_i` is less than `0`, |
| 1208 | +`0` if `x_i` is equal to `0`, and `1` if `x_i` is greater than `0`. |
| 1209 | +
|
| 1210 | +Args: |
| 1211 | + x (usm_ndarray): |
| 1212 | + Input array, expected to have a numeric data type. |
| 1213 | + out ({None, usm_ndarray}, optional): |
| 1214 | + Output array to populate. |
| 1215 | + Array have the correct shape and the expected data type. |
| 1216 | + order ("C","F","A","K", optional): |
| 1217 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1218 | + Default: "K". |
| 1219 | +Returns: |
| 1220 | + usm_narray: |
| 1221 | + An array containing the element-wise results. The data type of the |
| 1222 | + returned array is determined by the Type Promotion Rules. |
| 1223 | +""" |
| 1224 | + |
| 1225 | +sign = UnaryElementwiseFunc( |
| 1226 | + "sign", ti._sign_result_type, ti._sign, _sign_docstring |
| 1227 | +) |
1182 | 1228 |
|
1183 | 1229 | # U30: ==== SIN (x)
|
1184 | 1230 | _sin_docstring = """
|
|
0 commit comments