Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Inexact floating-point compare



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__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.