Problem 1275. Find smallest integer type to accommodate your number

MATLAB supports 1-, 2-, 4-, and 8-byte storage for integer data. Find the smallest integer type to accomodate a scalar integer.


a = -10;
c = findclass(a)
c =


a = 300;
c = findclass(a)
c =

Always prefer unsigned integer types if the integer is greater than 0!

Solution Stats

71.43% Correct | 28.57% Incorrect
Last solution submitted on May 09, 2017


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!