Floating-Point Numbers

Data Types

Floating-Point Numbers

🙋 Need help? Ask an expert now!

Floating-point types represent real numbers and have a range of values and precision. The one downside of floating-points is that they can behave abnormally during calculations and result in the loss of precision. The floating-point size depends on the platform (the browser and the OS). 32-bit OS's and browsers have 32 bits for numbers, while 64-bit have 64 bits. Therefore, it is good idea to use 32-bit numbers as they will work on any platform, including 64-bit platforms. Floating-point types usually have a decimal and are extremely useful in JavaScript.

Edit Me on GitHub!