You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculates an implementation-dependent approximation to the base ``10`` logarithm, having domain ``[0, +infinity]`` and codomain ``[-infinity, +infinity]``, for each element ``x_i`` of the input array ``x``.
1351
+
r"""
1352
+
Calculates an implementation-dependent approximation to the base ``10`` logarithm for each element ``x_i`` of the input array ``x``.
1353
1353
1354
1354
**Special cases**
1355
1355
1356
-
For floating-point operands,
1356
+
For real-valued floating-point operands,
1357
1357
1358
1358
- If ``x_i`` is ``NaN``, the result is ``NaN``.
1359
1359
- If ``x_i`` is less than ``0``, the result is ``NaN``.
1360
1360
- If ``x_i`` is either ``+0`` or ``-0``, the result is ``-infinity``.
1361
1361
- If ``x_i`` is ``1``, the result is ``+0``.
1362
1362
- If ``x_i`` is ``+infinity``, the result is ``+infinity``.
1363
1363
1364
+
For complex floating-point operands, special cases must be handled as if the operation is implemented using the standard change of base formula
1365
+
1366
+
.. math::
1367
+
\log_{10} x = \frac{\log_{e} x}{\log_{e} 10}
1368
+
1369
+
where :math:`\log_{e}` is the natural logarithm, as implemented by :func:`~array_api.log`.
1370
+
1371
+
.. note::
1372
+
For complex floating-point operands, ``log10(conj(x))`` must equal ``conj(log10(x))``.
1373
+
1364
1374
Parameters
1365
1375
----------
1366
1376
x: array
1367
-
input array. Should have a real-valued floating-point data type.
1377
+
input array. Should have a floating-point data type.
1368
1378
1369
1379
Returns
1370
1380
-------
1371
1381
out: array
1372
-
an array containing the evaluated base ``10`` logarithm for each element in ``x``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
1382
+
an array containing the evaluated base ``10`` logarithm for each element in ``x``. The returned array must have a floating-point data type determined by :ref:`type-promotion`.
0 commit comments