I have this problem. I get the result from the function `double sin(double x)`of the library cmath. I want to write this result in a file declared as `ofstream file`and I want that when the result is close to zero, write `0.000000` and not `1.22465e-16`.
For example, I tried:

```
`double x=sin(interval*c);
 file<<"value:"<<x;
 printf("value:%f",x);`

```

where the multiplication between `interval`and `c` is about π.

But in the file is written`1.22465e-16`, while in the shell is written `0.000000`. How can i do to get the approximation`0.000000` in ofstream file? Thanks all