[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #31579] Floating point mod function does not m
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #31579] Floating point mod function does not match Matlab |
Date: |
Tue, 09 Nov 2010 19:08:28 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101028 Iceweasel/3.5.15 (like Firefox/3.5.15) |
Follow-up Comment #5, bug #31579 (project octave):
I checked in the following change for the copysign problem:
http://hg.savannah.gnu.org/hgweb/octave/rev/009d16b010fa
Yes, I think we should report the problem. The current behavior of fmod does
not seem good to me, but maybe there is some reason for it? Though if there
is, I can't really see it.
After doing some debugging, it looks like fmod is ultimately computed by the
following function in glibc, at least on my system:
http://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/ieee754/dbl-64/e_fmod.c;h=2ce613574a0d7aad233dc2ba77036309f45681fd;hb=HEAD
Yowza. That level of bit twiddling is far beyond my ability to comprehend,
much less fix.
In any case, even if fmod is fixed, I think we still need our versions of rem
and mod so that we can be compatible with Matlab's "round if within eps"
feature.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31579>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/