octave-bug-tracker
[Top][All Lists]
Advanced

[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: Rik
Subject: [Octave-bug-tracker] [bug #31579] Floating point mod function does not match Matlab
Date: Tue, 09 Nov 2010 18:14:42 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12

Follow-up Comment #3, bug #31579 (project octave):

The new mod/rem routines always copy the sign bit.  This does no harm when
the remainder is zero, but does look a bit odd.  For example:


mod (2,-1)
ans = -0

whereas in 3.2.4
mod (2,-1)
ans = 0


The change below would fix it, but it isn't critical to implement it.


original:
if (x != y && y != 0)
  retval = copysignf (retval, y);
new:
if (x != y && y != 0 && retval !=0)
  retval = copysignf (retval, y);


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31579>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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