Definition at line 3 of file Complex.php.
◆ __construct()
Complex::__construct |
( |
|
$realPart, |
|
|
|
$imaginaryPart = null , |
|
|
|
$suffix = 'i' |
|
) |
| |
◆ __toString()
Definition at line 95 of file Complex.php.
References $suffix.
97 if ($this->imaginaryPart != 0.0) {
98 if (abs($this->imaginaryPart) != 1.0) {
101 $str .= (($this->imaginaryPart < 0.0) ?
'-' :
''). $this->suffix;
104 if ($this->realPart != 0.0) {
105 if (($str) && ($this->imaginaryPart > 0.0))
107 $str = $this->realPart . $str;
◆ _parseComplex()
static Complex::_parseComplex |
( |
|
$complexNumber | ) |
|
|
static |
Definition at line 9 of file Complex.php.
References array.
12 if (is_numeric($complexNumber))
13 return array( $complexNumber, 0, NULL );
16 if (strpos($complexNumber,
'+-') !== FALSE)
17 $complexNumber = str_replace(
'+-',
'-',$complexNumber);
18 if (strpos($complexNumber,
'++') !== FALSE)
19 $complexNumber = str_replace(
'++',
'+',$complexNumber);
20 if (strpos($complexNumber,
'--') !== FALSE)
21 $complexNumber = str_replace(
'--',
'-',$complexNumber);
24 $validComplex = preg_match(
'/^([\-\+]?(\d+\.?\d*|\d*\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?)([\-\+]?(\d+\.?\d*|\d*\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?)?(([\-\+]?)([ij]?))$/ui',$complexNumber,$complexParts);
28 $validComplex = preg_match(
'/^([\-\+]?)([ij])$/ui',$complexNumber,$complexParts);
30 throw new Exception(
'COMPLEX: Invalid complex number');
34 if ($complexParts[1] ===
'-') {
35 $imaginary = 0 - $imaginary;
37 return array(0, $imaginary, $complexParts[2]);
41 if (($complexParts[4] ===
'') && ($complexParts[9] !==
'')) {
42 if ($complexParts[7] !== $complexParts[9]) {
44 if ($complexParts[8] ===
'-') {
45 $complexParts[4] = -1;
49 $complexParts[4] = $complexParts[1];
55 return array( $complexParts[1],
57 !empty($complexParts[9]) ? $complexParts[9] :
'i' Create styles array
The data for the language used.
◆ getImaginary()
Complex::getImaginary |
( |
| ) |
|
◆ getReal()
◆ getSuffix()
◆ $imaginaryPart
Complex::$imaginaryPart = 0 |
|
private |
◆ $realPart
◆ $suffix
The documentation for this class was generated from the following file:
- libs/composer/vendor/phpoffice/phpexcel/unitTests/custom/Complex.php