Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

double 型数据比较时注意

Posted by 10250903 at 2009-05-03 11:15:51 on Problem 1244
如果
dis[i][j]=pow(3.0,0.5);
dis[i][k]=pow(3.0,0.5);
那么
if(dis[i][j]==dis[i][j])
{
    ……
}
if将判断为false,必须写成
if(abs(dis[i][j]-dis[i][k])<0.0000001)
{
    ……
}


					

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator