Ejemplo n.º 1
0
 /**
  * Create complex power from a float
  *
  * @param float $a operand
  * @param ComplexType $exp exponent
  *
  * @return NI|ComplexType|FloatType
  */
 private function floatComplexPow($a, ComplexType $exp)
 {
     if ($exp->isZero()) {
         return new FloatType(1);
     }
     return $this->complexExponent($a, $exp);
 }
Ejemplo n.º 2
0
 public function testIsZeroReturnsFalseIfComplexIsNotZero()
 {
     $c = new ComplexType($this->createRationalType(0), $this->createRationalType(1));
     $this->assertFalse($c->isZero());
     $c2 = new ComplexType($this->createRationalType(1), $this->createRationalType(0));
     $this->assertFalse($c2->isZero());
 }