help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave 3.0.1 available for ftp


From: John W. Eaton
Subject: Re: Octave 3.0.1 available for ftp
Date: Thu, 24 Apr 2008 13:36:23 -0400

On 24-Apr-2008, Michael Goffioul wrote:

| On Thu, Apr 24, 2008 at 3:38 PM, Tatsuro MATSUOKA <address@hidden> wrote:
| > Hello David
| >
| >  Thank you for your reply.
| >
| >  --- David Bateman <address@hidden> wrote:
| >  > Wouldn't it better better to have the autoconf test refuse to set
| >  > HAVE_ROUND for mingw rather than hard code in the source.. Alternatively
| >  > we code test the behavior of the round function in an autoconf test to
| >  > see if it fails for the case near bitmax, though that would be more work
| >  > to implement..
| >  >
| >  > D.
| >
| >  What you said is right.  However, I do not have enough knowledge of auto 
tools.
| >  And I cannot understand what is the problem with 'round' implemeted in the 
MinGW g++ 3.4.5.
| >  If you suggest me a autoconf modification, I will test to it and report 
here.
| 
| The code used internally by MinGW for "round" is the following
| (http://www.koders.com/c/fidB63EAFA2C117AAFC1CF9FE9691F8DDBE4DD01A22.aspx)
| 
| double
| round (double x)
| {
|   /* Add +/- 0.5 then then round towards zero.  */
|   return trunc ( x + (x >= 0.0 ?  0.5 : -0.5));
| }
| 
| The problem with this implementation is when x is the vicinity of bitmax: it
| leads to floating-point overflow (in the mantissa) and produces rounding 
error,
| For instance if x = bitmax, round(x) => bitmax+1, while it should return
| bitmax.
| 
| Octave used to use the above implementation for MSVC, but because of
| this problem, I switched it to use the (more robust) gnulib implementation.

Please report the problem to the MinGW maintainers.  In the meantime,
it would be helpful to have a configure test that actually tests the
feature, not just that we are running on a MinGW system.  That way,
the test should automatically switch to using code from MinGW when the
problem is fixed in their sources.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]