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

New to MATLAB?

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

17 correct solutions 8 incorrect solutions
Last solution submitted on Oct 03, 2014