Skip to content
Related Articles

Related Articles

Improve Article

JavaScript Number EPSILON Property

  • Last Updated : 18 May, 2021

This property shows the difference between 1 and the smallest floating point number which is greater than 1. When we calculate the value of EPSILON property we found it as 2 to the power -52 (2^-52) which gives us a value of 2.2204460492503130808472633361816E-16.


Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!



  • It is a non-writable property which means this property is not writable.
  • It is a non-enumerable property which means this property is not countable.
  • It is a non-configurable property which means this property is not configurable.

Note: Number.EPSILON can be used to test the equality of the floating-point numbers.

Uses: This Number.EPSILON property is used to check whether floating-point numbers are equal or not.

In this EPSILON is accessed by calling the Number as a class name. 

Example: The following example demonstrates the Number.EPSILON property in JavaScript.


  gfgval = Number.EPSILON;
  // Output will be value of 2 to the power -52 (2^-52)
  x = 0.3;
  y = 0.6;
  z = 0.9;
  // Output will be false
  console.log(x + y == z);
  // Output will be true
  console.log(x + y - z < gfgval);



There is a different way to execute floating-point numbers in JavaScript. Here 0.3 + 0.6 is not resulting exactly 0.9. So in place of using the usual testing procedure which will not work here, we can use JavaScript Number.EPSILON property to check that their difference should be smaller than the value of the Number.EPSILON.

My Personal Notes arrow_drop_up
Recommended Articles
Page :