29.9k views
4 votes
Which datatype will work better if you only need to store the whole numbers between -500 and 500 in a particular attribute field?

a) Short integer
b) Long integer
c) Double precision float
d) Single precision float

1 Answer

5 votes

Final answer:

A Short integer is the best datatype to store the whole numbers between -500 and 500 due to its sufficient range and efficient memory usage.

Step-by-step explanation:

The datatype best suited to store the whole numbers between -500 and 500 is a) Short integer. This is because a short integer type in most programming environments is capable of storing values within the range of -32,768 to 32,767. This range more than covers the required -500 to 500 range, making it the most efficient choice in terms of memory consumption compared to the long integer, double precision float, or single precision float datatypes which are designed to handle much larger or more complex numbers.

User Agillgilla
by
7.8k points