[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65538] xint_value does not work the way it is
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #65538] xint_value does not work the way it is intended |
Date: |
Fri, 29 Mar 2024 16:19:49 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?65538>
Summary: xint_value does not work the way it is intended
Group: GNU Octave
Submitter: arungiridhar
Submitted: Fri 29 Mar 2024 04:19:49 PM EDT
Category: Coding Style and Maintenance
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Missed Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: dev
Discussion Lock: Any
Operating System: Any
Fixed Release: None
Planned Release: 9.2.0 (current stable)
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 29 Mar 2024 04:19:49 PM EDT By: Arun Giridhar <arungiridhar>
There are several instances of xint_value in the codebase like this in the
all() DEFUN in data.cc:
int dim = (nargin == 1 ? -1
: args(1).xint_value ("all: DIM must be an integer")-1);
This looks like it will trap non-integer inputs to DIM, but nothing happens:
octave:1> all (true(3,3), pi)
ans =
1 1 1
1 1 1
1 1 1
octave:2> all (true(3,3), e)
ans =
1
1
1
octave:3> all (true(3,3), (sqrt(5) + 1) / 2)
ans =
1 1 1
What is the correct way to trap non-integer input?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65538>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65538] xint_value does not work the way it is intended,
Arun Giridhar <=