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

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

[Octave-bug-tracker] [bug #45587] rem(-0, 1) returns 0 instead of -0


From: Charles Karney
Subject: [Octave-bug-tracker] [bug #45587] rem(-0, 1) returns 0 instead of -0
Date: Tue, 21 Jul 2015 18:09:25 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0

Follow-up Comment #7, bug #45587 (project octave):

I don't think MATLAB treats "second arg = 1" as a special case.  For
example

  atan2d(rem(-0,360),-1) -> -180

Here are the other cases you asked for...

  atan2d(rem(-0, 0), -1)              -> NaN
  atan2d(rem(-0, -0), -1)             -> NaN
  atan2d(rem([-0 0], [0 0]), [-1 -1]) -> NaN NaN
  atan2d(rem([-0 0], [1 1]), [-1 -1]) -> -180 180
  atan2d(rem(4, -0), -1)              -> NaN
  atan2d(rem(-4, -0), -1)             -> NaN
  atan2d(rem(4, 1), -1)               -> 180
  atan2d(rem(-4, 1), -1)              -> -180

I believe that this behavior mimics that of the C++ function std::fmod.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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