Weirdness

Justin Hawkins justin at hawkins.id.au
Mon Feb 25 17:19:41 GMT 2008


Dan Rowles wrote:

> So my question to you is, should I report this as a bug somewhere, or 
> should I just ignore it as "floating point weirdness"?

man perlfaq4 has some answers.

In general, measuring equality of floating point numbers is asking for 
trouble. Computers hate fractions just like primary school kids.

Calculate the difference and make sure it's sufficiently small, where 
'sufficiently small' is defined by your test pass criteria :-)

	- Justin

-- 
Justin Hawkins
justin at hawkins.id.au
http://hawkins.id.au/~justin


More information about the london.pm mailing list