Skip to main content

NDArray::divide

public static function divide(NDArray|array|float|int $a, NDArray|array|float|int $b): NDArray|float|int;

Return the division between two arrays element-wise


Parameters​

$a $b​

  • Type - NDArray | array | scalar
  • Input arrays

Return​

NDArray​

  • Array with the division between $a and $b element-wise

Notes​

tip

GPU SUPPORTED​

This operation is supported by GPU (VRAM) and contains a custom CUDA kernel.


Examples​

use \NDArray as nd;

$c = nd::divide([5, 2, -3], [4, 3, 2]);

print_r($c);
[1.25, 0.666667, -1.5]