Compare values of two arrays – classic asp

This function: Function diffArray( aA, aB ) ‘ !! http://en.wikipedia.org/wiki/Union_%28set_theory%29 ‘ The union of two sets A and B is the collection of points which are in A or ‘ in B (or in both) Dim dicU : Set dicU = CreateObject( “Scripting.Dictionary” ) ‘ !! http://en.wikipedia.org/wiki/Intersection_%28set_theory%29 ‘ the intersection of two sets A and … Read more

Should we compare floating point numbers for equality against a *relative* error?

It all depends on the specific problem domain. Yes, using relative error will be more correct in the general case, but it can be significantly less efficient since it involves an extra floating-point division. If you know the approximate scale of the numbers in your problem, using an absolute error is acceptable. This page outlines … Read more