function r = realmax(cls)
%MATLAB Code Generation Library Function

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

if eml_ambiguous_types && nargin > 0 && ~coder.internal.isCharOrScalarString(cls)
    % There is another realmin in lib/fixedpoint/@embedded/@fi, and
    % that one accepts non-character inputs as well. During size
    % propagation, this function can accidentally called instead,
    % so bail out gracefully.
    r = eml_not_const(0);
    return
end
if nargin == 0
    cls = 'double';
else
    coder.internal.prefer_const(cls);
    eml_invariant(coder.internal.isCharOrScalarString(cls), ...
        'Coder:toolbox:realmax_1', ...
        'IfNotConst','Fail');
    eml_invariant(strcmp(cls,'single') || strcmp(cls,'double'), ...
        'Coder:toolbox:realmax_2', ...
        'IfNotConst','Fail');
end
r = coder.const(coder.internal.realmax(cls));
