bugGNU Octave - Bugs: bug #54484, Difference in divide by zero...

 
 

bug #54484: Difference in divide by zero warning

Submitted by:  Arnaud Delorme <arnodelorme>
Submitted on:  Thu 09 Aug 2018 09:31:28 PM UTC  
 
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  4.4.0 Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Tue 14 Aug 2018 01:18:34 AM UTC, comment #6:

I started investigating returning NaNs and found another issue with our unnecessary calculation of the 1-norm of matrices in a few places. I checked in a change for that here (https://hg.savannah.gnu.org/hgweb/octave/rev/f5ea7511c405).

Rik <rik5>
Project Administrator
Fri 10 Aug 2018 05:14:13 PM UTC, comment #5:

Very much agreed.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 10 Aug 2018 04:40:59 PM UTC, comment #4:

I don't think we need to have the exact same return matrix. However, it might be useful to return all NaNs so that subsequent calculations are impossible.

Under Octave, someone might be do a division of a singular matrix in the midst of a chain of computations and an all zeros matrix might allow processing to continue.

Simple example:

If you are running a script in batch mode, or otherwise fail to see the warning message, then you might think the end result is correct.

Rik <rik5>
Project Administrator
Fri 10 Aug 2018 04:34:51 PM UTC, comment #3:

Matlab r2018b prerel. gives a similar warning but returns

Philip Nienhuis <philipnienhuis>
Project Member
Fri 10 Aug 2018 03:44:40 PM UTC, comment #2:

I can't remember exactly where, but this issue has been discussed. I think the concensus was actually to remove the warning. It is an extra step that Octave has to do to check the denominator argument and we would prefer simply to pass the division operation directly to BLAS and let it throw an error if it needs to.

@Marco: In Matlab, what is the warning for

Under Octave, I get

Rik <rik5>
Project Administrator
Fri 10 Aug 2018 06:49:53 AM UTC, comment #1:

@Arnaud: a division by zero must alarm uninformed used, imho. I think we already discussed it, but I cannot find the reference. Anyway, matlab already gives a warning for things like

So, I think octave is more consistent. As a teacher, I cannot support your proposal.

Marco Caliari <caliari>
Project Member
Thu 09 Aug 2018 09:31:28 PM UTC, original submission:

When using Octave -- traditional

1/0

generates a warning but Matlab 2018a (and to my knowledge earlier versions down to Matlab 5.3) do not.
This can be alarming to uninformed users.

Is it possible to disable that warning in traditional mode?

Arno

Arnaud Delorme <arnodelorme>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by arnodelorme (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-10 caliari Severity3 - Normal => 1 - Wish
        Operating SystemMac OS => Any

    Back to the top


    Powered by Savane 3.3