This demo only works with integers. Please shift the decimal point in both numbers accordingly.
Source code available here
This file exposes a single function div(a, b);
which divides "a" by "b".
The result will be an object with these properties:
The number as written by humans with an optional leading "-" if the result is negative. If the result contains repeating decimals it will be up to the first full run of decimals before the repetition starts.
The total number of decimal digits in this number. For repeating numbers, this will be the total number of decimals before the repetition starts
This is 1 if the result is positive and -1 if negative. A zero is considered positive
Specifies from which position after the decimal the digits repeat. This is zero if there is no repetition. A 1 would be beginning right at the decimal point.