%% $RCSfile: sfun_udt_util.tlc,v $
%% Copyright 1990-2002 The MathWorks, Inc.
%%
%% Abstract:
%%      TLC-file containing conversion utilities for
%%      matlabroot/simulnk/src/sfun_utd.c
%%
%% $Revision: 1.3 $


%% Function FcnDataCnvBtw ======================================================
%% Abstract:
%%   Convert scalar of type "Data" to type double
%function FcnDataCnvBtw(outDType,inDType,inLabel,options,outLabel) Output
   if (%<inLabel>.res == HI_RES) {
     %<outLabel> = ((double) %<inLabel>.value)/127.0;
   } else {
     %<outLabel> = (double) %<inLabel>.value;
   }
   %return 1
%endfunction

%% Function FcnDataIsPos ======================================================
%% Abstract:
%%   is scalar of type "Data" positive?
%function FcnDataIsPos(inDType,inLabel,options,outLabel) Output
  %<outLabel> = %<inLabel>.value > 0;
  %return 1
%endfunction

%% Function FcnDataSign ======================================================
%% Abstract:
%%   is scalar of type "Data" positive, negative, or zero?
%function FcnDataSign(inDType,inLabel,options,outLabel) Output
  if (%<inLabel>.value > 0) {
    %<outLabel> = 1;
  } else if (%<inLabel>.value == 0) {
    %<outLabel> = 0;
  } else {
    %<outLabel> = -1;
  }
  %return 1
%endfunction

