"Sugapablo" wrote:

Ok, so what would the fix be?

There is no fix to computational error if you want to continue to represent

numbers in binary any more than there is a fix to the general problem that

some numbers cannot be represented with a finite number of decimals.

If you are asking what you can do for your particular problem, then the

answer depends on what you want. If, for example, you only care about what

is being displayed, then use one of the appropriate methods/functions. Note

that these both return STRINGS:

JScript:

http://msdn.microsoft.com/library/en...mthtofixed.asp
vbscript

:

http://msdn.microsoft.com/library/en...rmatnumber.asp
On the other hand, if you are trying to test for equality (or some other

relation), you will have to redefine those terms. Pick an arbitrary error

margin, such as 0.0001, and define equality to be "within the margin of

error", less than to be "NOT greater than by more than the margin of error",

etc. Your new system should work something like this:

JScript:

OLD NEW

A == B Math.abs(A-B) < e

A != B Math.abs(A-B) > e

A < B A < B+e

A > B A > B-e

vbscript

:

OLD NEW

A = B Abs(A-B) < e

A <> B Abs(A-B) > e

A < B A < B+e

A > B A > B-e

Because of computational error, there is little difference in meaning

between > and >= or < and <=. The endpoints are simply too unreliable to

make that distinction.

--

Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use

of this email address implies consent to these terms. Please do not contact

me directly or ask me to contact you directly for assistance. If your

question is worth asking, it's worth posting.