On 21Oct2013 17:06, Markus Engel wrote:
> Hi,
>
> in 2geom/coord.h there is an epsilon defined as 1e5. This is used in
> many
> ways, e. g. in Geom::are_near, .
>
> Now I'm wondering why this value is that big.
Probably related to the precision limit of a small series of 32 bit
float operations being around 1e6. 2geom may use all doubles (I did
not look), but probably there are applications that pass it 32 bit
floats that are promoted to doubles, which does not provide more
precision than the original value. For a little measure of safety to
handle precision loss in longish calculations they probably went up to
1e5.
> Is there any reason why "1e18" has been commented out?
Way too much precision for 32 bit float, would be my guess.
I ran into this issue a couple of decades ago in a simple problem: given
an arbitrarily oriented unit vector and a radius A is which side of a
plane defined by a point and another unit vector does A*vector lie? All
of the values were regular float, not double. By the time all the math
was done the final comparison was fuzzy to around 1e6.
Regards,
David Mathog
mathog@...
Manager, Sequence Analysis Facility, Biology Division, Caltech
