Write here if you have problems with your C++ source code
Moderator: Board moderators
- New poster
- Posts: 22
- Joined: Sun Jan 01, 2006 1:43 pm
- Location: Bangladesh
how can i solve prescision error when comparing to long double value?
i use fabs(a - b) <= EPS where EPS is 1e-15, but its not working.
use fabs(a - b) < EPS also but its not working again.
- A great helper
- Posts: 274
- Joined: Wed Oct 20, 2004 11:51 pm
- Location: Hong Kong
This depends on the problem.
But I think 1e-15 is too small. I ususally use 1e-9 or even 1e-6.