Mail Archives: cygwin/2009/09/01/12:22:17
--0-967799276-1251822104=:31910
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi DaveK,
the following test case on complex numbers=20
is producing, puzzling result on cygwin (both 1.5 and 1,7)=20
with gcc-4.3.2 (and also 3.4.4), while working on other platform:
#include <iostream>
#include "oct-cmplx.h"
int main ()
{
Complex z1 (1.0, 1.0), z2 (1.0, 1.0);
std::cout << (arg(z1)) << '\n';
std::cout << (arg(z2)) << '\n';
std::cout << (arg(z1)<arg(z2)) << '\n';
std::cout << (arg(z1)-arg(z2)) << '\n';
}
$ g++-4 comp_2.cc -o0 -o comp_2
$ ./comp_2
0.785398
0.785398
1
-3.06287e-17 <<-- arg(1+i) is lower then arg(1+i) !!
Using different complex numbers is also possible to get=20
arg(-1-i) bigger then arg(-1-i)
Any idea what could cause it ? newlib ?
Thanks
Marco
=20=20=20=20=20=20
--0-967799276-1251822104=:31910
Content-Type: application/octet-stream; name="oct-cmplx.h"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="oct-cmplx.h"
LyoKCkNvcHlyaWdodCAoQykgMTk5NSwgMTk5NiwgMTk5NywgMjAwMCwgMjAw
MSwgMjAwNCwgMjAwNSwgMjAwNywgMjAwOCwgMjAwOQogICAgICAgICAgICAg
IEpvaG4gVy4gRWF0b24KClRoaXMgZmlsZSBpcyBwYXJ0IG9mIE9jdGF2ZS4K
Ck9jdGF2ZSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0
ZSBpdCBhbmQvb3IgbW9kaWZ5IGl0CnVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUg
R05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5IHRo
ZQpGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDMg
b2YgdGhlIExpY2Vuc2UsIG9yIChhdCB5b3VyCm9wdGlvbikgYW55IG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6OmFicyAoYik7IFwKICByZXR1cm4gYSBPUFMgYngg
fHwgKGEgPT0gYnggJiYgMCBPUCBzdGQ6OmFyZyAoYikpOyBcCn0gXAoKREVG
X0NPTVBMRVhSX0NPTVAgKD4sID4pCkRFRl9DT01QTEVYUl9DT01QICg8LCA8
KQpERUZfQ09NUExFWFJfQ09NUCAoPD0sIDwpCkRFRl9DT01QTEVYUl9DT01Q
ICg+PSwgPikKCiNlbmRpZgoKLyoKOzs7IExvY2FsIFZhcmlhYmxlczogKioq
Cjs7OyBtb2RlOiBDKysgKioqCjs7OyBFbmQ6ICoqKgoqLwo=
--0-967799276-1251822104=:31910
Content-Type: application/octet-stream; name="comp_2.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="comp_2.cc"
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSAib2N0LWNtcGx4LmgiCgpp
bnQgbWFpbiAoKQp7CiAgQ29tcGxleCB6MSAoMS4wLCAxLjApLCB6MiAoMS4w
LCAxLjApOwogIHN0ZDo6Y291dCA8PCAoYXJnKHoxKSkgPDwgJ1xuJzsKICBz
dGQ6OmNvdXQgPDwgKGFyZyh6MikpIDw8ICdcbic7CiAgc3RkOjpjb3V0IDw8
IChhcmcoejEpPGFyZyh6MikpIDw8ICdcbic7CiAgc3RkOjpjb3V0IDw8IChh
cmcoejEpLWFyZyh6MikpIDw8ICdcbic7Cn0KCg==
--0-967799276-1251822104=:31910
Content-Type: text/plain; charset=us-ascii
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
--0-967799276-1251822104=:31910--
- Raw text -