BigNumber, simplify, and exactFractions don't interoperate well
- Dominant language
- JavaScript
- Stars
- 15.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
is there any chance to use bigNumbers and simplify ?
my config is this :
```
math.config({
number: 'BigNumber', // Default type of number:
// 'number' (default), 'BigNumber', or 'Fraction'
precision: 509 // Number of significant digits for BigNumbers
})
```
```
const f = math.parse('2/3+3');
const simplified = math.simplify(f,{},{exactFractions:true});
console.log(simplified.toString());
```
I get :
`3.6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667`
the correct answer should be :
`11 / 3`
if I use this config, I loose my precious bigNumbers and fall on number format which I want to avoid
```
math.config({
number: 'number', // Default type of number:
// 'number' (default), 'BigNumber', or 'Fraction'
precision: 509 // Number of significant digits for BigNumbers
})
math.simplify('(3/2)^20').toString()
'3.486784401e+9 / 1.048576e+6'
```
If only I could get this format with bigNumbers :'(
```
math.simplify('(3/2)^20').toString()
'3486784401 / 1048576'
```
Am I missing something ? I haven't found any details in the documentation about simplify with bigNumbers
Kind regards,
Nicolas
Contributor guide
Assessment
This issue has not been assessed yet.