function test_inport_pairs = util_is_precision_lost(simData)
% Copyright 2017 The MathWorks, Inc.
%
% Function to check if any input value in simData will lose precision when
% cast to double datatype (g1583531). Returns a list of (Test Case id,
% Inport id) pairs for which precision loss will occur.

    test_inport_pairs = [];
    idx = 1;
    for i = 1:numel(simData)   % For each test-case
        tc = simData(i);
        for j = 1:numel(tc.dataValues)   % For each Inport's dataValues
            dv = tc.dataValues{j};
            if ~isfi(dv)
                continue;
            end

            if ~isequal(dv, cast(double(dv), 'like', dv))   % Fixed-point value is not equal to double value
                test_inport_pairs(idx, 1) = i;   %#ok<AGROW>
                test_inport_pairs(idx, 2) = j;   %#ok<AGROW>
                idx = idx + 1;
            end
        end
    end
end