Answer the question
In order to leave comments, you need to log in
How to get a number without letter e?
There is a + b = 712577413488402631964821329 but in the browser the result is 7.125774134884027e+26;
Maybe there is such a method in javascript that will make this number normal - 712577413488402631964821329 ??
Answer the question
In order to leave comments, you need to log in
For example like this (my code once solved a similar problem on codewars ):
function sumStrings(s1, s2) {
if (s1.length < s2.length) [s1, s2] = [s2, s1];
s1 = [...s1].reduceRight((a, c, i) => {
c = +c + ~~s2[i - (s1.length - s2.length)] + a.r;
a.s = c % 10 + a.s;
a.r = c / 10 | 0;
return a;
}, {r: 0, s: ''});
return ((s1.r || '') + s1.s).replace(/^0+(?=\d)/, '');
}
Number.MAX_SAFE_INTEGER
9007199254740991
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question