Skip to content
Snippets Groups Projects
Verified Commit 267bec0a authored by Houtan Bastani's avatar Houtan Bastani
Browse files

add comments about rounding

parent 79d4b888
Branches
No related tags found
No related merge requests found
Pipeline #674 failed
......@@ -37,6 +37,7 @@ precision = 10^precision;
data = setDataToZeroFromZeroTol(o, data);
for i=1:size(data,1)
fprintf(fid, '&');
% Use round half away from zero rounding
output = round(data(i)*precision)/precision;
if isnan(output)
fprintf(fid, '%s', o.tableNaNSymb);
......
......@@ -99,6 +99,7 @@ for i = 1:nrows
if val < o.zeroTol && val > -o.zeroTol
val = 0;
end
% Use round half away from zero rounding
val = round(val*rounding)/rounding;
if isnan(val)
val = o.tableNaNSymb;
......
......@@ -15,7 +15,7 @@ function o = printSeries(o, fid, dser, dates, precision)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2014-2016 Dynare Team
% Copyright (C) 2014-2019 Dynare Team
%
% This file is part of Dynare.
%
......@@ -47,7 +47,7 @@ for i=1:size(data,1)
end
fprintf(fid, '[');
end
% Use round half away from zero rounding
output = round(data(i)*precision)/precision;
if isnan(output)
fprintf(fid, '%s', o.tableNaNSymb);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment