Path: news.mathworks.com!not-for-mail
From: "Michael" <michael@circular-logic.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: floating point calc differences between Matlab and C?
Date: Thu, 26 Mar 2009 02:38:01 +0000 (UTC)
Organization: Circular Logic
Lines: 16
Message-ID: <gqepq9$a43$1@fred.mathworks.com>
References: <gqeaq9$56$1@fred.mathworks.com> <OpAyl.3844$mF1.1542@newsfe23.iad>
Reply-To: "Michael" <michael@circular-logic.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1238035081 10371 172.30.248.35 (26 Mar 2009 02:38:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 26 Mar 2009 02:38:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1151890
Xref: news.mathworks.com comp.soft-sys.matlab:527810

> > Perhaps these are a result of the floating point rounding mode being used on the processor.
> >  Is there a way to check and set the floating point rounding mode from Matlab?
> 
> Not on the Mac, not without writing some MEX to do it for you.
> 
> There is a system_dependant() call that [if I recall correctly] can do some
> things with the rounding modes for MS Windows.

Thanks Walter. When you say writing some MEX code to do it, do you mean a MEX file code effect the floating point rounding mode of MATLAB as it's running, or do you mean being able to change the rounding mode within the C code running as the MEX file?

I couldn't find how to do it in gcc. Do you know how?

Thanks again.

Cheers,
Michael