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

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

[Octave-bug-tracker] [bug #51283] function min/max inconsistent handling


From: Joel Dahne
Subject: [Octave-bug-tracker] [bug #51283] function min/max inconsistent handling of -0
Date: Wed, 21 Jun 2017 08:51:53 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

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

Matlab seems to always prefer the first one:

>> 1./max(-0, 0)
ans =
  -Inf
>> 1./max(0, -0)
ans =
   Inf
>> 1./max([-0, -0], [0, 0])
ans =
  -Inf  -Inf
>> 1./max([0, 0], [-0, -0])
ans =
   Inf   Inf

Though I'm not sure if this is intended or not, might just be that their code
happens to check the arguments in the same order for scalars and vectors.

In most cases this of course makes no difference, the reason I noticed it is
that in the interval package we have

>sin (infsup (0))
ans = [0]
> sin (infsup ([0, 0]))
ans = 1×2 interval vector
   [0, -0]   [0, -0]

and I were able to track it back to the max function.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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