summaryrefslogtreecommitdiff
path: root/src/type/testDoubleComplex.c
diff options
context:
space:
mode:
authorjofret2008-09-09 12:05:20 +0000
committerjofret2008-09-09 12:05:20 +0000
commitb92e3d00f07bb1816a8d85a5fc4d77099142597b (patch)
treea85a5b26d1f5f30a9aec975b559f69c093cf4e15 /src/type/testDoubleComplex.c
parent0cc36687f566ad0470dc40c7240e41e641874243 (diff)
downloadscilab2c-b92e3d00f07bb1816a8d85a5fc4d77099142597b.tar.gz
scilab2c-b92e3d00f07bb1816a8d85a5fc4d77099142597b.tar.bz2
scilab2c-b92e3d00f07bb1816a8d85a5fc4d77099142597b.zip
Remove addition and subtraction -> dedicated to operations module
Diffstat (limited to 'src/type/testDoubleComplex.c')
-rw-r--r--src/type/testDoubleComplex.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/type/testDoubleComplex.c b/src/type/testDoubleComplex.c
index ebfd8403..26e3416e 100644
--- a/src/type/testDoubleComplex.c
+++ b/src/type/testDoubleComplex.c
@@ -55,68 +55,7 @@ static int matrixCreation(void) {
return 0;
}
-static int addAndDiff(void) {
- /* z = -3 + 25*%i */
- doubleComplex z = DoubleComplex(3.0,-25.0);
- /* y = -3.123456 + 25.123456*%i */
- doubleComplex y = DoubleComplex(-3.123456,25.123456);
- /* t = z + y */
- doubleComplex t = zadds(z,y);
- /* u = z - y */
- doubleComplex u = zdiffs(z,y);
-
-
- /* z = -3 + 25*%i */
- printf("Partie reelle = %f\n", zreals(z));
- assert(zreals(z) == 3.0);
- printf("Partie imaginaire = %f\n", zimags(z));
- assert(zimags(z) == -25.0);
-
- /* y = -3.123456 + 25.123456*%i */
- printf("Partie reelle = %f\n", zreals(y));
- assert(zreals(y) == -3.123456);
- printf("Partie imaginaire = %f\n", zimags(y));
- assert(zimags(y) == 25.123456);
-
- /* Try to have somme addition */
- printf("Partie reelle = %f\n", zreals(t));
- assert(zreals(t) == 3.0 + -3.123456);
- printf("Partie imaginaire = %f\n", zimags(t));
- assert(zimags(t) == -25.0 + 25.123456);
-
- /* Try to have somme diff */
- printf("Partie reelle = %f\n", zreals(u));
- assert(zreals(u) == 3.0 - -3.123456);
- printf("Partie imaginaire = %f\n", zimags(u));
- assert(zimags(u) == -25.0 - 25.123456);
- return 0;
-}
-
-static int timesAndDevide(void) {
- /* z1 = 1 + i */
- doubleComplex z1 = DoubleComplex(1.0, 1.0);
- /* z2 = 2 + i */
- doubleComplex z2 = DoubleComplex(2.0, 1.0);
-
- doubleComplex z1_times_z2 = ztimess(z1, z2);
- doubleComplex z1_devide_z2 = zdevides(z1, z2);
-
- /* z1 * z2 = 1 + 3i */
- printf("z1_times_z2 = %e + %ei\n", zreals(z1_times_z2), zimags(z1_times_z2));
- assert(zreals(z1_times_z2) == 1.0);
- assert(zimags(z1_times_z2) == 3.0);
-
- /* z1 / z2 = 0.6 + 0.2i */
- printf("z1_devide_z2 = %e + %ei\n", zreals(z1_devide_z2), zimags(z1_devide_z2));
- assert(zreals(z1_devide_z2) == 0.6);
- assert(zimags(z1_devide_z2) == 0.2);
-
- return 0;
-}
-
int main(void) {
matrixCreation();
- addAndDiff();
- timesAndDevide();
return 0;
}