Skip to content
Snippets Groups Projects
Verified Commit 100f4d51 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Simplify octave_ver_less_than using builtin compare_versions()

parent 2b5de4c6
Branches
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ function r = octave_ver_less_than(verstr)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2008-2017 Dynare Team
% Copyright (C) 2008-2019 Dynare Team
%
% This file is part of Dynare.
%
......@@ -32,15 +32,6 @@ function r = octave_ver_less_than(verstr)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
cur_verstr = version();
r = compare_versions(version(), verstr, "<");
r = get_ver_numeric(cur_verstr) < get_ver_numeric(verstr);
endfunction
function x = get_ver_numeric(verstr)
nums = sscanf(verstr, '%d.%d.%d')';
if length(nums) < 3
nums(3) = 0;
end
x = nums * [1; 0.01; 0.0001 ];
endfunction
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment