3 ms·
> echo 'scale=500-1;10/(10^20-10^10-1)' | BC_LINE_LENGTH=12 bc will give you the ten digit ones, with the last digit rounded up on the very end. I havent quit
by boxfire 11y ago
> echo 'scale=500-1;10/(10^20-10^10-1)' | BC_LINE_LENGTH=12 bc
will give you the ten digit ones, with the last digit rounded up on the very end.
I havent quite got an exact formula for scale before the rounding is wrong, e.g. for 100 digits:
> echo 'scale=50000-2000-1;10/(10^200-10^100-1)' | BC_LINE_LENGTH=102 bc
- discardorama 11y agoWhy not just use scale=499 instead of scale=500-1 ? I'm curious.
- boxfire 11y agoOriginally in my terminal I was experimenting to find a cutoff for the point where the numbers become inaccurate. All of those formulas were in terms of digits and had a -1 on the end.