Skip to content

Commit b85d0f6

Browse files
committed
isinteger doesn't check whether numbers are integers in the mathematical sense, but in the sense of datatype. As everything is a double by default in matlab, this is not what we wanted.
1 parent 613ef94 commit b85d0f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/I2MC/I2MCfunc.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
checkNumeric = @(x,k) assert(isnumeric(x),'The value of ''%s'' is invalid. Expected input to be one of these types:\n\ndouble, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64\n\nInstead its type was %s.',k,class(x));
4343
checkScalar = @(x,k) assert(isscalar(x),'The value of ''%s'' is invalid. Expected input to be a scalar.',k);
4444
checkNumel2 = @(x,k) assert(numel(x)==2,'The value of ''%s'' is invalid. Expected input to be an array with number of elements equal to 2.',k);
45-
checkInt = @(x,k) assert(isinteger(x),'The value of ''%s'' is invalid. Expected input to be integer-valued.',k);
45+
checkInt = @(x,k) assert(~any(mod(x,1)),'The value of ''%s'' is invalid. Expected input to be integer-valued.',k);
4646
for p=1:2:length(varargin)
4747
key = varargin{p};
4848
if p+1>length(varargin)

0 commit comments

Comments
 (0)