Precision Error

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

Moderator: Board moderators

Precision Error

Postby 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.
taskin
New poster
 
Posts: 22
Joined: Sun Jan 01, 2006 1:43 pm
Location: Bangladesh

Postby 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.
User avatar
Cho
A great helper
 
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong


Return to C++

Who is online

Users browsing this forum: No registered users and 0 guests