3 kyu

Divide numbers as strings

183 of 205osofem

Description:

Divide numbers as strings

  1. Input can be integer, negative, zero, or decimal in string format.
  2. Input may be very large.
  3. Input won't have leading or trailing zeroes.
  4. Result should be returned as strings without leading or trailing zeroes.
  5. Recurring results should be to 20 decimal places. i.e. 1/3 should return 0.33333333333333333333. Just stop computing when your result gets to 20 decimal places. (i.e. no need to compute to 21 decimal places and round to 20 decimal places).
  6. If divisor is zero, throw Error (Exception in PHP).
  7. 0.00000000000000000000 is just 0.

You may first attempt Voile's Divide integers as strings as an appetizer.

Note: bignumber.js is not allowed and your code length should be less than or equal to 6000 symbols.

Mathematics
Big Integers
Fundamentals

Stats:

CreatedAug 11, 2017
PublishedAug 16, 2017
Warriors Trained2614
Total Skips533
Total Code Submissions6581
Total Times Completed205
JavaScript Completions183
PHP Completions23
Total Stars107
% of votes with a positive feedback rating85% of 53
Total "Very Satisfied" Votes41
Total "Somewhat Satisfied" Votes8
Total "Not Satisfied" Votes4
Total Rank Assessments4
Average Assessed Rank
3 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
4 kyu
Ad
Contributors
  • osofem Avatar
  • monadius Avatar
Ad