josdejong / josdejong/mathjs

how to identify periods in decimals of bignumbers

Open
#3,176 5 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Hello, maybe a stupid question, but is there a natural way to get periodicity in BigNumbers decimals

```
math.config({
number: 'BigNumber', // Default type of number:
// 'number' (default), 'BigNumber', or 'Fraction'
precision: 20 // Number of significant digits for BigNumbers
})
math.divide(math.bignumber(1),math.bignumber(6)).toFixed();
'0.16666666666666666667'
```

as you can see it ends with digit '7'

I wish to identify here a period of length 1 starting at decimal 2 :
'0.1 ͞6'

thx

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.