MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > floating point control settings 

I have a complicated numerical procedure written in C that has been compiled into a library. When I call one function from a short, standalone C program, I get one answer. When I call the same compiled code from matlab (through a mex interface), I get a slightly different answer. The difference is very small, out in the last digit of accuracy, but it causes a later problem that is serious. (I have to take the result of this calculation and plug it into a function with restricted domain; the slight inaccuracy causes that function to blow up, e.g. sqrt(1.0e14).) 
Subject: floating point control settings From: Roger Stafford Date: 29 Sep, 2010 03:15:31 Message: 2 of 11 
"John" <jpnolan.nospam@mathworks.com> wrote in message <i7u7se$c4d$1@fred.mathworks.com>... 
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i7ub0j$3tm$1@fred.mathworks.com>... 
Subject: floating point control settings From: Mark Shore Date: 29 Sep, 2010 05:03:04 Message: 4 of 11 
> > 
Subject: floating point control settings From: Roger Stafford Date: 29 Sep, 2010 06:01:23 Message: 5 of 11 
"John" <jpnolan.nospam@mathworks.com> wrote in message <i7ucvh$9mb$1@fred.mathworks.com>... 
Subject: floating point control settings From: Bruno Luong Date: 29 Sep, 2010 06:12:07 Message: 6 of 11 
"John" <jpnolan.nospam@mathworks.com> wrote in message <i7u7se$c4d$1@fred.mathworks.com>... 
Subject: floating point control settings From: Bruno Luong Date: 29 Sep, 2010 06:24:28 Message: 7 of 11 
"John" <jpnolan.nospam@mathworks.com> wrote in message <i7ucvh$9mb$1@fred.mathworks.com>... 
Subject: floating point control settings From: James Tursa Date: 29 Sep, 2010 06:26:05 Message: 8 of 11 
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i7uknj$s3i$1@fred.mathworks.com>... 
"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <i7um5t$o6$1@fred.mathworks.com>... 
Subject: floating point control settings From: James Tursa Date: 29 Sep, 2010 18:44:33 Message: 10 of 11 
"John" <jpnolan.nospam@mathworks.com> wrote in message <i7vfe0$pnc$1@fred.mathworks.com>... 
Subject: floating point control settings From: Walter Roberson Date: 29 Sep, 2010 18:52:01 Message: 11 of 11 
On 100929 01:44 PM, James Tursa wrote: 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.