24 public static function IMDIV($complexDividend, $complexDivisor)
30 return (
string) (
new ComplexObject($complexDividend))->divideby(
new ComplexObject($complexDivisor));
31 }
catch (ComplexException $e) {
49 public static function IMSUB($complexNumber1, $complexNumber2)
55 return (
string) (
new ComplexObject($complexNumber1))->subtract(
new ComplexObject($complexNumber2));
56 }
catch (ComplexException $e) {
73 public static function IMSUM(...$complexNumbers)
76 $returnValue =
new ComplexObject(0.0);
81 foreach ($aArgs as $complex) {
82 $returnValue = $returnValue->add(
new ComplexObject($complex));
84 }
catch (ComplexException $e) {
88 return (
string) $returnValue;
106 $returnValue =
new ComplexObject(1.0);
111 foreach ($aArgs as $complex) {
112 $returnValue = $returnValue->multiply(
new ComplexObject($complex));
114 }
catch (ComplexException $e) {
118 return (
string) $returnValue;
An exception for terminatinating execution or to throw for unit testing.
static IMSUB($complexNumber1, $complexNumber2)
IMSUB.
static IMSUM(... $complexNumbers)
IMSUM.
static IMPRODUCT(... $complexNumbers)
IMPRODUCT.
static IMDIV($complexDividend, $complexDivisor)
IMDIV.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.