Closed jefdaj closed 7 years ago
Never mind, this is what fromRationalRepetend
is for right?
1/6 is a repeating decimal: 0.1(6). Since a Scientific
stores the actual decimal digits representing an infinite number of them takes infinite time and space.
Indeed use fromRationalRepetend. Do note that this function consumes space linear in the number of digits in the resulting scientific. For 0.1(6) that's not a problem though since the repetition starts very early.
Can you tell a bit more about your use-case?
This hangs with 100% CPU on my machine:
Have I stumbled on a bug in division, or parsing, or am I doing something wrong? It only happens with certain numbers. For example "4.0" instead of "6.0" works.