Precision Error

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
taskin
New poster
Posts: 22
Joined: Sun Jan 01, 2006 1:43 pm
Location: Bangladesh

Precision Error

Post by taskin » Fri Apr 07, 2006 9:25 am

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.

User avatar
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho » Fri Apr 07, 2006 5:43 pm

This depends on the problem.
But I think 1e-15 is too small. I ususally use 1e-9 or even 1e-6.

Post Reply

Return to “C++”