mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 03:32:28 +00:00 
			
		
		
		
	tabs, indentation
This commit is contained in:
		
							parent
							
								
									7232877d92
								
							
						
					
					
						commit
						e9f7d558e3
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		|  | @ -47,13 +47,13 @@ class ComplexExpr: | |||
|         return ComplexExpr(other.r*self.r - other.i*self.i, other.i*self.r + other.r*self.i) | ||||
| 
 | ||||
|     def __pow__(self, k): | ||||
| 	if k == 0: | ||||
| 	    return ComplexExpr(1, 0) | ||||
| 	if k == 1: | ||||
| 	    return self | ||||
| 	if k < 0: | ||||
| 	    return (self ** (-k)).inv() | ||||
| 	return reduce(lambda x, y: x * y, [self for _ in xrange(k)], ComplexExpr(1, 0)) | ||||
|         if k == 0: | ||||
|             return ComplexExpr(1, 0) | ||||
|         if k == 1: | ||||
|             return self | ||||
|         if k < 0: | ||||
|             return (self ** (-k)).inv() | ||||
|         return reduce(lambda x, y: x * y, [self for _ in xrange(k)], ComplexExpr(1, 0)) | ||||
| 
 | ||||
|     def inv(self): | ||||
|         den = self.r*self.r + self.i*self.i | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue