You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tround.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/rutgers/utility
    
    the code of the file until where you have to start completion: function [Y]=tround(X, CT)

% TROUND: Rounding function with a Fuzzy or Tolerant Floor function
%
% [x]=tround(X, CT)
%
% Floating point rounding function with a Fuzzy or Tolerant Floor
% function.
%  
% On Input:
%
%    X         Double precision argument to be operated on. It is
%              assumed that X is represented with m mantissa bits.
%
%    CT        Comparison Tolerance such that 0 < CT <= 3-SQRT(5)/2.
%              If the relative difference between X and a whole
%              number is less than CT, then TFLOOR is returned as
%              this whole number. By treating the floating-point
%              numbers as a finite ordered set, note that the
%              heuristic EPS=2.**(-(m-1)) and CT=3*eps causes
%              arguments of TFLOOR/TCEIL to be treated as whole
%              numbers if they are exactly whole numbers or are
%              immediately adjacent to whole number representations.
%              Since EPS, the  "distance"  between  floating-point
%              numbers on the unit interval, and m, the number of
%              bits in X mantissa, exist on every  floating-point
%              computer, TFLOOR/TCEIL are consistently definable
%              on every floating-point computer.
%
% On Input:
%
%    Y         Double precision round of X.
%
% Usage:
%
%    CT = 3 * eps(X)         That is, CT is about 1 bit on either
%                            side of X mantissa bits.
%     Y = round(X, CT)
%
% References:
%
%    P. E. Hagerty, 1978: More on Fuzzy Floor and Ceiling, APL QUOTE
%      QUAD 8(4):20-24. (The TFLOOR=FL5 took five years of refereed
%      evolution publication).
%
%    L. M. Breed, 1978: Definitions for Fuzzy Floor and Ceiling, APL
%      QUOTE QUAD 8(3):16-23.
%
% Adapted from H.D. Knoble code (Penn State University).

% svn $Id: tround.m 938 2019-01-28 06:35:10Z arango $
%=========================================================================%
%  Copyright (c) 2002-2019 The ROMS/TOMS Group                            %
%    Licensed under a MIT/X style license                                 %
%    See License_ROMS.txt                           Hernan G. Arango      %
%=========================================================================%

Y=tfloor(X+0.5d0, CT);

return

%--------------------------------------------------------------------------

    
function [Y]=tround(X, CT)

% TROUND: Rounding function with a Fuzzy or Tolerant Floor function
%
% [x]=tround(X, CT)
%
% Floating point rounding function with a Fuzzy or Tolerant Floor
% function.
%  
% On Input:
%
%    X         Double precision argument to be operated on. It is
%              assumed that X is represented with m mantissa bits.
%
%    CT        Comparison Tolerance such that 0 < CT <= 3-SQRT(5)/2.
%              If the relative difference between X and a whole
%              number is less than CT, then TFLOOR is returned as
%              this whole number. By treating the floating-point
%              numbers as a finite ordered set, note that the
%              heuristic EPS=2.**(-(m-1)) and CT=3*eps causes
%              arguments of TFLOOR/TCEIL to be treated as whole
%              numbers if they are exactly whole numbers or are
%              immediately adjacent to whole number representations.
%              Since EPS, the  "distance"  between  floating-point
%              numbers on the unit interval, and m, the number of
%              bits in X mantissa, exist on every  floating-point
%              computer, TFLOOR/TCEIL are consistently definable
%              on every floating-point computer.
%
% On Input:
%
%    Y         Double precision round of X.
%
% Usage:
%
%    CT = 3 * eps(X)         That is, CT is about 1 bit on either
%                            side of X mantissa bits.
%     Y = round(X, CT)
%
% References:
%
%    P. E. Hagerty, 1978: More on Fuzzy Floor and Ceiling, APL QUOTE
%      QUAD 8(4):20-24. (The TFLOOR=FL5 took five years of refereed
%      evolution publication).
%
%    L. M. Breed, 1978: Definitions for Fuzzy Floor and Ceiling, APL
%      QUOTE QUAD 8(3):16-23.
%
% Adapted from H.D. Knoble code (Penn State University).

% svn $Id: tround.m 938 2019-01-28 06:35:10Z arango $
%=========================================================================%
%  Copyright (c) 2002-2019 The ROMS/TOMS Group                            %
%    Licensed under a MIT/X style license                                 %
%    See License_ROMS.txt                           Hernan G. Arango      %
%=========================================================================%

Y=tfloor(X+0.5d0, CT);

return

%--------------------------------------------------------------------------

function [Y]=tceil(X, CT)

% Double precision Tolerant ceiling function.

Y=-tfloor(-X, CT);

return

%--------------------------------------------------------------------------

function [Y]=tfloor(X, CT)

% Double precision Tolerant floor function: Hagerty FL5 function.

Q=1.0d0;
if (X < 0.0d0)
  Q=1.0d0-CT;
end