Q. What does console.log(0.1 + 0.2) approximate?

A
0.3
B
0.30000000000000004
C
0.2
D
error
Solution:

Due to floating-point arithmetic, 0.1 + 0.2 approximates to 0.30000000000000004.

Entri PDF Icon

Get Question Bank

Strengthen Your Practice with our comprehensive question bank.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!