eigenmath/conj.cpp

31 lines
357 B
C++
Raw Permalink Normal View History

2007-08-25 19:04:21 +02:00
// Complex conjugate
#include "stdafx.h"
#include "defs.h"
void
eval_conj(void)
{
push(cadr(p1));
eval();
p1 = pop();
push(p1);
if (!find(p1, imaginaryunit)) { // example: (-1)^(1/3)
polar();
conjugate();
2007-08-25 19:17:49 +02:00
clockform();
2007-08-25 19:04:21 +02:00
} else
conjugate();
}
void
conjugate(void)
{
push(imaginaryunit);
push(imaginaryunit);
negate();
subst();
eval();
}