function imin = intmin(classname)
%MATLAB Code Generation Library Function

%   Copyright 2002-2014 The MathWorks, Inc.
%#codegen
coder.internal.allowHalfInputs;
if nargin == 0
    imin = int32(-2147483648);
elseif eml_ambiguous_types && ~coder.internal.isCharOrScalarString(classname)
    % This case is to prevent spurious errors with fi inputs.
    imin = int32(0);
else
    eml_invariant(coder.internal.isCharOrScalarString(classname), ...
        'MATLAB:intmin:inputMustBeString', ...
        'IfNotConst','Fail');
    switch (classname)
        case 'int8'
            imin = int8(-128);
        case 'uint8'
            imin = uint8(0);
        case 'int16'
            imin = int16(-32768);
        case 'uint16'
            imin = uint16(0);
        case 'int32'
            imin = int32(-2147483648);
        case 'uint32'
            imin = uint32(0);
        case 'int64'
            imin = int64(-9223372036854775808);
        case 'uint64'
            imin = uint64(0);
        case 'coder.internal.indexInt'
            imin = coder.internal.intMin(classname);
        otherwise
            eml_invariant(false, ...
                'MATLAB:intmin:invalidClassName', ...
                'IfNotConst','Fail');
    end
end


