bugGNU Octave - Bugs: bug #46672, magic (N) should not error for any...

 
 

bug #46672: magic (N) should not error for any integer input values

Submitted by:  Bernardo Sulzbach <mafagafogigante>
Submitted on:  Sat 12 Dec 2015 03:03:23 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 12 Dec 2015 03:43:22 PM UTC, comment #1:

Pushed and rebased:

http://hg.savannah.gnu.org/hgweb/octave/rev/cdf08aacfd86

If you want to get rid of your local copy of this commit, do

hg strip -r c42e0b0c73927b862dc57930059b1eee0700e974

After that, pull again.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Sat 12 Dec 2015 03:03:23 PM UTC, original submission:

MATLAB behavior:

Octave old behavior:

Octave behavior after this patch

Old documentation note: Note: N must be greater than 2 for the magic square to exist.

New documentation note: Note: N must be a scalar greater than or equal to 3. If you supply N less than 3, magic returns either a nonmagic square, or else the degenerate magic squares 1 and [].

The new docs reflect MATLAB documentation and perfectly describe the new behavior of magic(N) for these "odd" values of N.

The tests provided in magic.m pass with my patch.

Bernardo Sulzbach <mafagafogigante>

 

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

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by mafagafogigante (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 Dec 2015 03:57:42 PM UTCjordighStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sat 12 Dec 2015 03:28:05 PM UTCmafagafogiganteAttached File-=>Added magic-matlab-compatibility.diff, #35707
    Sat 12 Dec 2015 03:07:13 PM UTCmafagafogiganteAttached File-=>Added magic-m-matlab-compatibility.diff, #35703

    Back to the top


    Powered by Savane 3.1-cleanup1