# Precision problem while solving Cody Problems

1 view (last 30 days)

Show older comments

While solving Cody problems, I have often encountered that my answer is not accepted because of the precision doesn't match the required answer. Matlab always rounds the double format to 4 digits after decimal. My logic seems correct on paper, but fails while applied as a code due to the precision problem.

Here's an example

Can somebody help me how to change this or how I can output more than 4 digits?

I know I can use vpa, but cody doesn't accept vpa and also it is symbolic.

##### 6 Comments

Walter Roberson
on 18 Oct 2020

### Accepted Answer

goc3
on 10 Nov 2020

##### 0 Comments

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!