What is the difference between a number and an integer?

What is the difference between a number and an integer

@Anuj_Tiwari

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? :white_check_mark: Yes :x: No
Precision & Scale :white_check_mark: Customizable :x: Fixed as whole numbers
2 Likes