开发者

Problem with difficult caclulation in JavaScript

Is it possible to get different result in different browsers with some math operation? E.g. something like that

if(vote!=0)total_reiting = Math.round((full_reiting/vote)*100)/100;
var star_widht = full_reiting*17/vote;
$('#raiting_votes').width(star_widht);
$('#raiting_info b').append(total_reiting);
Mb its bettter to use back-end calculation? Or its better in any case to hadle logic o开发者_StackOverflow中文版n beck-end?


I doubt you would get different results on a different browser, although the nature of floating point and rounding makes it possible that you'd get different results under a different implementation. I just think it's very unlikely you'll ever see that.


MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜