11-18-2005 10:56 PM
11-18-2005 11:07 PM - edited 11-18-2005 11:07 PM
... though not looking specifically at bits-of-mantissa, maybe this is close enough(?) - if you see a problem, please share.
Message Edited by Dynamik on 11-18-2005 11:11 PM
Message Edited by Dynamik on 11-18-2005 11:12 PM
11-19-2005 03:06 AM - edited 11-19-2005 03:06 AM
Message Edited by altenbach on 11-19-2005 01:07 AM
11-19-2005 05:26 AM
altenbach a écrit:
Well, I think it would be simpler to just divide the two numbers and see how close to 1 the result is. 🙂 See image.
Hummmfff.... err... ahhh...
And what happens when X 2 is equal to zero (of course with X 1 = to something time 10 to the minus whatever you want ) ? 😉 😄
11-19-2005 08:32 AM
Hi Dynamik,
I think this is what you want.
Xu
11-19-2005 10:07 AM
@chilly charly wrote:
And what happens when X 2 is equal to zero (of course with X 1 = to something time 10 to the minus whatever you want ) ? 😉 😄
11-19-2005 11:13 AM
@Xu wrote:
I think this is what you want.
11-19-2005 07:08 PM
11-21-2005 10:09 AM
Hi Altenbach,
Could you give an example (if the two numbers are very, very close but have a different exponent) ?
As my understand, my vi works for denormalized ones. Could you give an example?
I noted another problem in my VI's comment: "tolerance: 1, 2, ..., cannot be too large." should be "tolerance: 0, 1, 2, ..., cannot be too large."
Thank you for your comments,
Xu
11-21-2005 11:10 AM
@Xu wrote:
Could you give an example (if the two numbers are very, very close but have a different exponent) ?
Try for example x1=2 and x2=2-delta (where delta is a very small number)
(SGL example: x1=2, x2=1.99989998, tolerance=any (0..32!). Your VI says they are not equal.)
I said it does not work if one number is denormalized and the other is normalized and you try to compare them. Even if their value is identical, your VI would flag them as different (see e.g. http://stevehollasch.com/cgindex/coding/ieeefloat.html )