The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Significant digits for complex numbers?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

verrallr@a

Canada
44 Posts

Posted - 04/08/2005 :  3:46:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:NT

It seems we cannot double-precision complex numbers. We can only get 7 signicant figures for each of the real and imaginary part. Is that correct?

Richard.

easwar

USA
1965 Posts

Posted - 04/08/2005 :  4:38:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Richard,

We tested and it works fine:


#define CC_REAL_PART 0.9876543210987e300
#define CC_IMAGINARY_PART 0.1234567890123e-280

void test_complex()
{
complex cc;

cc.m_re = CC_REAL_PART;

cc.m_im = CC_IMAGINARY_PART;

printf("real part = %17.13e\nimag. part = %17.13e\n", cc.m_re, cc.m_im);

ASSERT(cc.m_re == CC_REAL_PART);
ASSERT(cc.m_im == CC_IMAGINARY_PART);

return;
}



Easwar
OriginLab



Edited by - easwar on 04/08/2005 5:00:06 PM
Go to Top of Page

verrallr@a

Canada
44 Posts

Posted - 04/08/2005 :  11:36:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OK, thanks Easwar.
In my code, when running Debug and watching Local Variables, it only appears as 7 digits. But, maybe thats just for space. I also used a small program in Origin's help, and it seemed to show only 7 digits. But, your example is conclusive.

Thanks much,
Richard.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000