public function div($divisor)
{
if ($divisor instanceof NumArray) {
$divisor = $divisor->getData();
}
$this->data = Map::mapArray($this->data, $divisor, function ($data1, $data2) {
if ($data2) {
return $data1 / $data2;
}
throw new DivideByZeroException("Dividing by zero is forbidden");
});
$this->shape = Shape::getShape($this->data);
$this->flushCache();
return $this;
}