4 kyu
better Add Floats
339 of 340bakula
Description:
Write a function that returns the sum of the passed arguments. The input arguments may be Numbers and/or String representations of numbers. The function must return a String.
Example
add(123, "321") === "444";
add("1234567890.0987654321", "8765432109.9012345678") === "9999999999.9999999999";
add("1.2.3", 1.23); === NaN;
add(0.1, 0.0001) === "0.1001";
Notes
The input numbers may be very very big and/or very very small. Addition must be exact - no floating point errors. The numbers are all positive and base 10. Some arguments may not be numbers. In these cases, return NaN. Remove trailing zeros and decimal point if possible.
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Nov 26, 2013 |
Published | Nov 26, 2013 |
Warriors Trained | 1035 |
Total Skips | 246 |
Total Code Submissions | 6699 |
Total Times Completed | 340 |
JavaScript Completions | 339 |
Total Stars | 32 |
% of votes with a positive feedback rating | 79% of 112 |
Total "Very Satisfied" Votes | 78 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 14 |
Total Rank Assessments | 8 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |