Number

Not-Ethan's avatar
Published Mar 11, 2022Updated Feb 28, 2023
Contribute to Docs

Numbers include -1, 0, 1, and so on. Depending on the language, numbers with decimals are of a different type. In floating-point arithmetic, there is a trade-off in precision for range. The amount of bits allocated for floating-point representation affects the range in values that can be used.

  • Start your programming journey with an introduction to the world of code and basic concepts.
    • Includes 5 Courses
    • With Certificate
    • Beginner Friendly.
      4 hours
  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

Arithmetic Accuracy

Languages such as JavaScript and Python yield interesting results when arithmetic operations are performed on numeric values. For example, .1 + .2 would evaluate to 0.30000000000000004, whereas adding whole numbers wouldn’t do this. But you need to keep in mind the integer limit. It is the number where the compiler won’t understand the numbers anymore.

All contributors

Contribute to Docs

Learn General on Codecademy

  • Start your programming journey with an introduction to the world of code and basic concepts.
    • Includes 5 Courses
    • With Certificate
    • Beginner Friendly.
      4 hours
  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours