function x = sign(x)
%MATLAB Code Generation Library Function

%   Copyright 2002-2019 The MathWorks, Inc.
%#codegen

coder.internal.allowHalfInputs;
eml_invariant(nargin > 0,'MATLAB:minrhs');
eml_invariant(coder.internal.isBuiltInNumeric(x) || isa(x,'half') || ...
    islogical(x) || ischar(x), ...
    'Coder:toolbox:unsupportedClass',mfilename,class(x));
eml_invariant(isreal(x) || ~isinteger(x),'MATLAB:complexInteger');
if islogical(x)
    x = double(x);
elseif ischar(x)
    x = sign(double(x));
else
    x = coder.internal.applyScalarFunctionInPlace(mfilename,@coder.internal.scalar.sign,x);
end
