Because JavaScript uses floating point math which can lead to rounding errors.
If you need an exact result with two decimal places, multiply your numbers with 100
before the operation and then divide again afterwards:
var result = ( 4990 % 10 ) / 100;
Round if necessary.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…