Files
2026-07-13 13:30:25 +08:00

10 lines
245 B
Matlab
Executable File

function z = isequalf(x, y, tol)
% Determine whether two float number x and y are equal up to precision tol
% Written by Mo Chen (sth4nth@gmail.com).
if nargin < 3
tol = 1e-8;
end
assert(all(size(x)==size(y)));
z = max(abs(x(:)-y(:)))<tol;