Javascript Computation Error (Numerical Error In Simple Calculation) -


solved:

read:

  1. is floating point math broken?
  2. how deal floating point number precision in javascript?

just javascript processing environment , type:

150.3 + 150.03 

simple calculation, doesn't seem give right result (it doesn't matter if write "150.30 + 150.03" or so).

it gives result: 300.33000000000004.

any ideas why?

ps: read articles both on stack overflow , wikipedia wrong computing calculations due finite precision, nothing seemed relevant case.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -