469,307 Members | 1,898 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

Perl math question

Hi,

When I do this in Perl:

if ((35/26) == (0.35/0.26)) {
print "equal\n";
}
else {
print "not equal\n";
}

I got "not equal". Does anyone know why? and solution?

Thanks,

Hao
Jan 23 '08 #1
3 1062
KevinADC
4,059 Expert 2GB
good question. If you get no answer here ask over on www.perlmonks.com and see if one of the gurus over there has an explanation. I would like to hear what the explanation is.
Jan 23 '08 #2
I found a simliar question in perlmonks.com.Here is the link to that question:
http://www.perlmonks.com/index.pl?node_id=293402

Thanks for help!
Jan 23 '08 #3
KevinADC
4,059 Expert 2GB
Cool. I should have known that, I have seen this problem before but the reason escaped me. Thanks for posting back.
Jan 23 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

58 posts views Thread by @ | last post: by
2 posts views Thread by TSO | last post: by
3 posts views Thread by Chris Pruett | last post: by
6 posts views Thread by WipeOut | last post: by
20 posts views Thread by Xah Lee | last post: by
reply views Thread by Xah Lee | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
13 posts views Thread by squash | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.