
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
Terje Mathisen <[EMAIL PROTECTED]> wrote:
:
: The easiest method would seem to be a subtract, scale, add and compare:
:
: double inexact_compare(double a, double b, int bits_to_skip)
: {
: // First the the regular difference:
: double diff = b - a;
:
: // Shift this difference down by the number of bits to ignore:
: double scaled_diff = diff / ((double) (2 << bits_to_skip));
:
This does not work for floating point..... or am I missing something
obvious?
Regards,
--buddy
--
Remove '.spaminator' and '.invalid' from email address
when replying.
| <-- __Chronological__ --> | <-- __Thread__ --> |