Skip to content

Commit

Permalink
More tests about vpa inequality
Browse files Browse the repository at this point in the history
Related to Issue #1285, linked to the xtest.  Probably waiting on
upstream fix.
  • Loading branch information
cbm755 committed Jan 29, 2024
1 parent 5fb5665 commit 16a2cb3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions inst/vpa.m
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,39 @@
%! c = vpa('1524157877488187881');
%! assert (isequal (b, c))

%!test
%! % isequal and other comparisons
%! a = vpa ("2/3", 32);
%! b = vpa ("2/3", 64);
%! assert (~ logical (a == b))
%! assert (~ isequal (a, b))
%! a = vpa ("1/3", 32);
%! b = vpa ("1/3", 64);
%! assert (~ logical (a == b))
%! assert (~ isequal (a, b))
%! a = vpa ("0.1", 32);
%! b = vpa ("0.1", 64);
%! assert (~ logical (a == b))
%! assert (~ isequal (a, b))

%!test
%! % isequal with array: Issue #1285
%! a = vpa ("2/3", 32);
%! b = vpa ("2/3", 64);
%! assert (~ isequal ([a 2*a], [b 2*b]))

%!xtest
%! % non-equality of vpa that "might be" be integers: Issue #1285
%! a = vpa ("123", 32);
%! b = vpa ("123", 64);
%! assert (~ logical (a == b))

%!test
%! % non-equality of vpa that "might be" be integers: Issue #1285
%! a = vpa ("123", 32);
%! b = vpa ("123", 64);
%! assert (~ isequal (a, b))

%!warning <dangerous> vpa ('sqrt(2.0)');

%!warning <dangerous>
Expand Down

0 comments on commit 16a2cb3

Please sign in to comment.