
From: Jeremy Bruestle
As far as testing, I've only done the basics, but things seem alright, with the possible concern that the range is 0 <= x <= 1 as opposed to 0 < x < 1, due to limited precision of floating point, esp when for example a is near 0 and b is very large. It's not a problem for my application, but perhaps someone who knows the IEEE floating point rules better than I could suggest a fix.
Well I don't know much about IEEE, but there's the brute force approach double result; do { result = clever_stuff(); } while (result != 0.0 && result != 1.0); return result; (Of course, that doesn't look so good when the parameters are such that result tends to be 0.0 a very large percentage of the time.) -- Martin Bonner Senior Software Engineer/Team Leader PI SHURLOK LTD Telephone: +44 1223 441434 / 203894 (direct) Fax: +44 1223 203999 Email: martin.bonner@pi-shurlok.com www.pi-shurlok.com disclaimer