Functions > Statistics > Combinatorial Analysis > Example: Finding Digits and Improving Result Precision
  
Example: Finding Digits and Improving Result Precision
To find the digit occupying a particular place within a number, divide the number by its base raised to the desired decimal place minus 1, and find the floor of the remainder.
1. Define a decimal number and the place of the desired digit within it.
Click to copy this expression
Click to copy this expression
2. Use functions floor and mod to find the digit in the 5th place.
Click to copy this expression
3. Show that the order of calculations can affect the precision of the results.
Click to copy this expression
Click to copy this expression
In the second case, there is no roundoff error because the expression inside the outside bracket is evaluated first without converting π to a number.
Therefore, you can improve the precision of your results by minding the order of operations.