Mercurial > octave-nkf
comparison src/xpow.cc @ 4790:91a84c9bdadb
[project @ 2004-02-19 20:15:17 by jwe]
author | jwe |
---|---|
date | Thu, 19 Feb 2004 20:15:18 +0000 |
parents | 994f449a1eba |
children | deed800e7bef |
comparison
equal
deleted
inserted
replaced
4789:ac4441e16ffa | 4790:91a84c9bdadb |
---|---|
563 ComplexMatrix result (nr, nc); | 563 ComplexMatrix result (nr, nc); |
564 for (int j = 0; j < nc; j++) | 564 for (int j = 0; j < nc; j++) |
565 for (int i = 0; i < nr; i++) | 565 for (int i = 0; i < nr; i++) |
566 { | 566 { |
567 OCTAVE_QUIT; | 567 OCTAVE_QUIT; |
568 | |
569 // XXX FIXME XXX -- avoid apparent GNU libm bug by | |
570 // converting A and B to complex instead of just A. | |
571 | |
568 Complex atmp (a (i, j)); | 572 Complex atmp (a (i, j)); |
569 result (i, j) = pow (atmp, b); | 573 Complex btmp (b); |
574 | |
575 result (i, j) = pow (atmp, btmp); | |
570 } | 576 } |
571 | 577 |
572 retval = result; | 578 retval = result; |
573 } | 579 } |
574 else | 580 else |
935 ComplexNDArray result (a.dims ()); | 941 ComplexNDArray result (a.dims ()); |
936 | 942 |
937 for (int i = 0; i < a.length (); i++) | 943 for (int i = 0; i < a.length (); i++) |
938 { | 944 { |
939 OCTAVE_QUIT; | 945 OCTAVE_QUIT; |
940 Complex atmp (a(i)); | 946 |
941 result(i) = pow (atmp, b); | 947 // XXX FIXME XXX -- avoid apparent GNU libm bug by |
948 // converting A and B to complex instead of just A. | |
949 | |
950 Complex atmp (a (i)); | |
951 Complex btmp (b); | |
952 | |
953 result(i) = pow (atmp, btmp); | |
942 } | 954 } |
943 | 955 |
944 retval = result; | 956 retval = result; |
945 } | 957 } |
946 else | 958 else |