What is the difference between a number and an integer
1 Like
NUMBER Datatype
-
Definition: A generic numeric data type that can store both integers and floating-point (decimal) numbers.
-
Example Values:
10,10.5,-3.14,100.0001 -
Usage: Used when both whole numbers and decimals need to be stored.
INTEGER Datatype
-
Definition: A numeric data type that only stores whole numbers (no decimals).
-
Example Values:
10,-5,100,0 -
No Decimal Support: Any decimal values assigned are typically rounded or rejected.
-
Usage: Used when only whole numbers are needed, such as IDs, counts, or enumerations.
| Feature | NUMBER | INTEGER |
|---|---|---|
| Can store decimals? | ||
| Precision & Scale |
3 Likes