octave-maintainers
[Top][All Lists]
Advanced

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

Re: Directed rounding


From: Eric Walter
Subject: Re: Directed rounding
Date: Thu, 17 Sep 2015 18:10:10 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Dear John,

Thanks for you quick replies and suggestions. As far as I am able to judge, you are absolutely right, and what would be needed is a simple access to fegetround and fesetround. Unfortunately, I will not be able to make it possible. I was just suggesting that it could be a useful feature for those who care about the accuracy of their floatting point computations, and a plus compared to MATLAB ands Scilab, which do not offer it.

Best regards,

Eric

Le 17/09/2015 17:58, John W. Eaton a écrit :
On 09/17/2015 11:57 AM, John W. Eaton wrote:
On 09/17/2015 11:43 AM, Juan Pablo Carbajal wrote:
On Thu, Sep 17, 2015 at 4:47 PM, Eric Walter
<address@hidden> wrote:
Dear colleagues,

If this is not already the case, would you please consider making
directed
rounding, as made available on all IEEE 747 compliant processors, simply accessible to gnu-octave users? This would help assessing the number of
significant digits in the results of floatting-point computation.

Best regards,

Eric Walter


Dear Eric,

I might not get the point correctly, but are the functions round, fix,
floor, ceil, sign, chop not doing what you need?

Please file a feature request "bug" on the bug tracker.

If I understand correctly, you are asking to make the functions
fegetround and fesetround available in Octave if they are supported by
the system, correct?

It should not be too hard for you to write your own wrappers for those
functions.  I'd probably define them to accept/return strings like
"nearest", "up", "down", "toward-zero" or similar.

If you do write your own, please consider contributing them.

Thanks,

jwe

Also, FWIW, the GNU C Library manual has this to say about changing rounding modes:

   You should avoid changing the rounding mode if possible.  It can be
an expensive operation; also, some hardware requires you to compile your
program differently for it to work.  The resulting code may run slower.
See your compiler documentation for details.

jwe





reply via email to

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