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
 Machine epsilon
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gpoon

USA
Posts

Posted - 06/08/2010 :  01:52:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8 and Service Release SR6 (Select Help-->About Origin):
Operating System: Windows XP

Hello!

I would know how to access the machine epsilon constant in Origin C. I read that it is accessible as the constant DBL_EPSILON, but that requires float.h, which doesn't seem to be available in Origin C. Alternatively, I tried to use the NAG function x02ajc which should compute this constant, but when I try to call it Origin C says:

Error, Function was called, but its body could not be located during linking.

My limited ability to read the nagx02.h file didn't give me any clues. I would appreciate any insight you can give.

Many thanks!
Gregory

Penn

China
644 Posts

Posted - 06/09/2010 :  01:13:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gregory,

In Origin 8.0, this constant is not available yet. We are very sorry for that. However, it can be accessed in current version, Origin 8.1 SR3. If you are interested, you can download a demo from this page to have a try.

For a workaround, you can define this constant by yourself. I have run the following code in Origin 8.1 SR3 to get the value.

#include <OC_nag8.h>
void testDBL_EPSILON()
{
	double dDBL_EPSILON = X02AJC;
	printf("d=%16.15e\n", dDBL_EPSILON);
}

And the value is 1.110223024625157e-016.

Penn
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