Discover MakerZone

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

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!

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!


Problem Group

Solution Statistics

18 correct solutions 8 incorrect solutions
Last solution submitted on Apr 06, 2016