bugGNU Octave - Bugs: bug #63664, det function bug

 
 

bug #63664: det function bug

Submitter:  None
Submitted:  Sat 14 Jan 2023 04:24:48 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 7.2.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 14 Jan 2023 06:28:10 PM UTC, comment #1: 

There's no bug with det. The problem is with OP's use of == to compare floating point values. Use abs(a-b) <= tolerance instead.

Closing as invalid.

Arun Giridhar <arungiridhar>
Group Member
Sat 14 Jan 2023 04:24:48 PM UTC, original submission:  

% _Code_testing

  % 1-st case
  B(1, 1) = 30;
  B(1, 2) = 40;
  B(2, 1) = -10;
  B(2, 2) = 0;
  Determinant_B = B(1, 1)*B(2, 2) - B(1, 2)*B(2, 1);
  if not(det(B) == Determinant_B)
    B
    Determinant_B
    Difference = abs(det(B) - Determinant_B)
  endif

  % 2-nd case
  B(1, 1) = 30;
  B(1, 2) = 40;
  B(2, 1) = -5;
  B(2, 2) = 0;
  Determinant_B = B(1, 1)*B(2, 2) - B(1, 2)*B(2, 1);
  if not(det(B) == Determinant_B)
   B
    Determinant_B
    Difference = abs(det(B) - Determinant_B)
  endif

  % 3-rd case
  B(1, 1) = 30;
  B(1, 2) = 40;
  B(2, 1) = -2.5;
  B(2, 2) = 0;
  Determinant_B = B(1, 1)*B(2, 2) - B(1, 2)*B(2, 1);

  if not(det(B) == Determinant_B)
   B
    Determinant_B
    Difference = abs(det(B) - Determinant_B)
  endif

Anonymous

 

(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

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by arungiridhar (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-14 arungiridhar StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2023-01-14 arungiridhar Dependencies- bugs #63665 is dependent

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code