1

what is maximum precision check we do for float and integer ?

 0 === 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 

true // output 

2 Answers2

1

Looking at:

> Number.MIN_VALUE
< 5e-324

Versus:

> '0.000--etc--0001'.length
< 487

We can see that your number is smaller than the allowable minimum non-zero float, so it gets rounded down to zero, making the expression effectively:

> 0 === 0.0
< true
Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
0

Javascript, Typescript has the only type of Number. By default, you can not declare float type. But you check the float value. I think you have the answer here. here

Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
Abir Mahmud
  • 96
  • 1
  • 7